Page 1 of 1

[Nagios-devel] Behavior of event handler - doesn't work alarm light

Posted: Wed Sep 07, 2005 1:33 am
by Guest


Dear sir,

I'm testing watching system by Nagios 2.0B4 with Fedora Core 4.

It work fine to watch ping check of some hosts and routers. Then, I modify
configuration file since I try to make notify by alarm light when Nagios detect
host or router error event.
But it doesn't work and current configuration is as follows;

[minimal.cfg, from sample configuration file for hosts, services]

# [ command section ]
# Notify alarm for Keiko-chan mini

define command{
command_name notify-to-keiko-chan
command_line
/usr/local/nagios/libexec/eventhandlers/notify-to-keiko-chan $HOSTSTATE$
$STATETYPE$ $HOSTATTEMPT$
}

# [ host section ]
define host{
use generic-host
host_name local1-ATX135
alias test local
address 172.17.0.150
check_command check-host-alive
max_check_attempts 10
event_handler notify-to-keiko-chan
notification_interval 120
contact_groups admins
}

[notify-to-keiko-chan, sh script for alarm light ]
#!/bin/sh
#
#
#
echo $1, $2
case "$2" in
HARD)
case "$1" in
UP)
;;
DOWN)
rsh 172.17.20.1 -l root RLY2 TurnOn -p dn1000
;;
esac
;;
esac
exit 0

- - - - -

1. "notify-to-keiko-chan" script work fine individually. For example,
"notify-to-keiko-chan DOWN HARD"

2. On nagios.log, it seem to see work fine, that is Nagios detect error and do
event handler when host has error.
[09-06-2005 22:03:21] HOST EVENT HANDLER:
local1-ATX135;DOWN;HARD;10;notify-to-keiko-chan
[09-06-2005 22:03:21] HOST ALERT: local1-ATX135;DOWN;HARD;10;CRITICAL - Host
Unreachable (172.17.0.150)
[09-06-2005 22:03:18] HOST EVENT HANDLER:
local1-ATX135;DOWN;SOFT;9;notify-to-keiko-chan

3. Our Nagios install by tarball on www.nagios.org.

4. Also our alarm light is worked by linux and accept rsh command. on event log
of alarm light, no event from nagios.


If anyone know how do I debug event handler, will you advise me?


Thank you for your help,


Takashi Maruyama

Aucnet Inc.
IT Department








This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]