Nagios event handlers using ssh

Peter Edmonds pedmonds at boursedata.com.au
Thu Dec 18 01:28:26 CET 2003


Luke Rosenthal wrote:

Bout the same for us.  Next step is trying to implement something with
net::ssh::perl that logs in and restarts services that fail, somehow
linked to event handlers.  Anyone had experience with this?  Could
check_by_ssh be given some creative commandline arguments?

Hi Luke,

I have one event handler setup along these lines. It is a bash script that
takes $SERVICESTATE$ $STATETYPE$ $SERVICEATTEMPT$ and $HOSTADDRESS$ and
ssh's into the target machine and restarts the service using Sysinternals
pstools (target machine is Windows, but could be Linux/Unix with correct
permissions). Output of pstools command gets emailed to preset email
address.

Works sensationally. Service blows up, event handler runs, service gets
started. Very cool.

Perl would be better and more secure, but I have had difficulty getting ssh
to work under perl :(

Let me know if you want example scripts

Peter Edmonds
Network Manager
BourseData



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
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