attempt recovery on service CRITICAL with nrpe
Shayne Lebrun
slebrun at muskoka.com
Fri Jan 31 21:32:30 CET 2003
Ok. Just for fun, I faked it using check_by_ssh.
In the service defintion:
event_handler reboot-remote-sillydaemon
Then in the checkcommand entry:
command_line command_line $USER1$/check_by_ssh -H $HOSTADDRESS$ -C
'/usr/local/nagios/eventhandlers/restart-sillydaemon $SERVICESTATE$
$STATETYPE$ $SERVICEATTEMPT$'
And that runs a typical eventhandler script, which looks for, in this case,
and UNKNOWN SOFT 2 state, then tries to restart the daemon in question.
The only thing is getting it to return something so the check_by_ssh doesn't
go 'critical - timeout' in ten seconds. But the daemon gets restarted, so
that's good enough.
-----Original Message-----
From: nagios-users-admin at lists.sourceforge.net
[mailto:nagios-users-admin at lists.sourceforge.net]On Behalf Of Shayne
Lebrun
Sent: Friday, January 31, 2003 1:34 PM
To: nagios-users at lists.sourceforge.net
Subject: RE: [Nagios-users] attempt recovery on service CRITICAL with
nrpe
If only NRPE could pass arguments, I could do something like:
event_handler check_nrpe!restart-sillydaemon
Then in your command:
command
command_line /path/check_nrpe -H $HOSTADDRESS$ -c
restart-sillydaemon -ArgChain $SERVICESTATUS$!$STATETYPE$!$SERVICEATTEMPT$
Then in the nrpe.cfg on the remote host:
command[restart-sillydaemon]=/path/restart-sillydaemon $ARG1$ $ARG2$ $ARG3$
i.e. I just want the ArgChain, !-delimited, separated into ARGn variables,
which nrpe could then send along said arguments to the commands.
Ah well. If wishes were horses, then beggers would ride.
Consider it a feature request. :-)
Muskoka.com
115 Manitoba Street
Bracebridge, Ontario
P1L 2B6
(705)645-6097
Muskoka.com is pleased to announce
New High Speed Services
please visit
http://www.muskoka.com/services.htm
for more information
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
More information about the Users
mailing list