daemon restart scripts
Eric Loyd
loyd at cyber.kodak.com
Thu Jan 13 16:45:28 CET 2005
Hard to answer. Here's what we do.
Most of our checks are done on remote hosts as active checks that we
wrap in an SSH tunnel first. Therefore, we know that on machine X,
service Y failed. So our restart script (which is the same script for
all event handlers) uses the service name to figure out what the daemon
is that failed, SSHs to the remote machine and executes a local copy of
itself with parameters that tell it what service failed.
Now, the remote machine (still running the same script) knows what to do
- the script has logic telling it what steps to take to restart service
X, service Y, and service Z. When it finishes, the SSH runnel ends, the
restart script on the Nagios box looks at some return codes, populates
an Oracle tracking database, and ends execution.
End result? All services can be restarted by one modular event
handler. If a new service is added that needs a new series of restart
steps, then a function is added to the restart script to do the work,
and all else just "works."
So the answer to your question is: The easiest way to implment restart
scripts depends on what you're restarting. :-)
Fred Blaise wrote:
>Hello all
>
>What would be the easiest way to implement restart scripts, for when a
>daemon is down, to try to bring it back up?
>
>Any pointers greatly appreciated.
>
>Thanks.
>
> ))fred
>
>
--
Eric Loyd
loyd at cyber.kodak.com
-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
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
More information about the Users
mailing list