Title: Untitled Document
Very interesting idea, Allan.

I might implement something similar.
If you don't mind, could you share more about this implementation?

Cheers,

 

Leandro Quibem Magnabosco
Consultor de TI
(48) 3251-5323
[email protected]
www.fcdl-sc.org.br

Rua: Rafael Bandeira, 41
CEP. 88015-450  Florianópolis - SC

"Este é um e-mail oriundo da Federação das Câmaras de Dirigentes Lojistas de Santa Catarina, e seu conteúdo é confidencial e destinado exclusivamente a seu(s) destinatário(s), não podendo ser copiado ou repassado,no todo ou em parte, a terceiros. Se esta mensagem foi-lhe enviada por engano, pedimos o obséquio de entrar em contato conosco.
This is an e-mail from the Federação das Câmaras de Dirigentes Lojistas de Santa Catarina and its contents are privileged and confidential to the ordinary user(s) of the e-mail address(es) to which it was addressed, and no one else may copy or forward all or any of it in any form. If this e-mail was sent to you in error, please contact us."



Allan Clark escreveu:

On Sep 3, 2009, at 13:18, Leandro Quibem Magnabosco <[email protected]> wrote:

"Olá" Leonardo,

Please note that Nagios uses mostly scripts to check services/disk/etc. and that those scripts that 'tell' nagios the status of the service/daemon/disk/etc.
That said, I think you should not focus on Nagios to be proactive hence that it's scripts could be used for that.

Let's say you have check_http configured to check www.example.com.
It would connect to www.example.com on port 80 and report if it suceeds on sending a cmd or not .
If something goes wrong, it would send a critical message back.
This does not mean that the script is necessarily alerting nagios about the problem, it is alerting whatever called it in the first place.

What I mean is, you don't *need* nagios to be in the middle of it and (IMO) you should not try to integrate it into this kind of solution because it would just make things more complicated.

One simple way to implement that would be improving the scripts that comes with nagios-plugins.
A "simple" if statement and some coding after it would do the trick.
If the script already has the capability to check the status of something and be aware of the present status and take active measures .

Interfere with the  "function" that prints the message "CRITICAL" to make it, for eg., "ssh -T host /etc/init.d/apache2 restart".

I have used the scripts from Nagios in a similar way: a project ("extotest") using Nagios plugins and autotools' autotest to check all critical services before and after complex firewall ACL changes. It's similar in that it leverages the good work of many contributors but doesn't use the Nagios Core as an engine.

In your case, a cronjob might suffice:

#!bash

case $(check_http -opt -opt) in
OK*)
   exit 0
   ;;
*)
   exec /etc/init.d/httpd restart
   ;;
esac

Allan
--

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Nagios-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting 
any issue. 
::: Messages without supporting info will risk being sent to /dev/null

Reply via email to