Event Handler Configuration Question

Thomas Beecher tbeecher at localnet.com
Fri Apr 29 16:05:40 CEST 2005


Please forgive me if this question has been addressed previously, but I 
was unable to find an answer in the list archives.

I currently use Nagios to monitor Lucent Portmasters in remote POPs. At 
present, when one goes down Nagios properly notifies us, and we call the 
colo to have someone manually reboot the device. Sometimes this does not 
work well, as if once goes down after hours we are stuck until someone 
gets paged to go to the colo.

Recently I've purchased a remote power controller that I can reboot 
individual outlets on, saving a phone call to have someone else do it. 
I've written a perl script that I use to specify which power controller 
and outlet number to cycle, and that works well.

What I would like to accomplish is to use Nagios' event handler options 
to call this script for me, hopefully saving me from getting out of bed 
at 3am!!


Basically:

For device 1:
	 Define event handler reboot_portmaster

Inside of the reboot_portmaster script:
	If device 1 is down soft:
		reboot outlet that device 1 is connected to
	If device 1 is down hard:
		reboot outlet that device 1 is connected to

So my questions are:

1. Inside of the host definition, can I define 2 variables such as:
	power_switch_ip		1.2.3.4
	power_switch_outlet	1

2. If I can create these variables, is it possible to pass them to the 
event handler script, something like:

define service{
	...
	...
	event_handler		restart_portmaster <ip> <outlet>
	}

define command{
	command_name	restart_portmaster
	command line	/path/restart_portmaster <ip> <outlet> $SERVICESTATE$ 
$STATETYPE$ $SERVICEATTEMPT$
	}

If I can get the IP and outlet variables this far, I can then pass them 
to the perl script that would be called from inside of restart_portmaster.

Thanks in advance for any insight you can provide.

-- 
Thomas Beecher II
Network Administrator
LocalNet, Inc
tbeecher at localnet.com



-------------------------------------------------------
SF.Net email is sponsored by: Tell us your software development plans!
Take this survey and enter to win a one-year sub to SourceForge.net
Plus IDC's 2005 look-ahead and a copy of this survey
Click here to start!  http://www.idcswdc.com/cgi-bin/survey?id=105hix
_______________________________________________
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