Event Handlers Problem

Thomas Beecher tbeecher at localnet.com
Wed May 4 16:31:18 CEST 2005


I am working with the Nagios event handlers, and I'm coming across a 
problem I can't seem to get a handle on.

I've got a perl script (restart_pm3.pl) that I want to be called as a 
host event handler, and pass two macros: $HOSTNAME$ and $HOSTSTATE$. At 
present, I have the following set up:

In hosts.cfg

define host{
         use             generic-host
         host_name       buftest
         alias           buftest
         address         10.0.2.152
         contact_groups  noc
         event_handler   restart_pm3
}

In checkcommands.cfg

define command{
         command_name    restart_pm3
         command_line    /home/tbeecher/test_scripts/restart_pm3.pl 
$HOSTNAME$ $HOSTSTATE$
}


The Nagios logs show that the even handler is called when the service 
checks fail and the host goes down:

[1115216792] HOST ALERT: buftest;DOWN;HARD;10;Telnet: CRITICAL - Socket 
timeout after 1 seconds<br>SNMP: CRITICAL: snmpget returned errors: 1 ( 
  )<br>PING: CRITICAL - Host Unreachable (10.0.2.152)
[1115216792] HOST EVENT HANDLER: buftest;DOWN;HARD;10;restart_pm3

So far so good right?

Well, the actual perl script is never executed. I have execute 
permissions on it for everyone, and edited it so it logs every time it 
is executed, and what ARGVs were passed to it. Works fine when called 
manuallt from a command line, but Nagios never calls is. Any insight?

Thanks!!

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



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
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