Behavior of event handler - doesn't work alarm light

Takashi Maruyama maruyamt at ns.aucnet.co.jp
Thu Sep 8 03:42:19 CEST 2005




Dear Sumit san,

Thank you for your advise and now I've confirmed about your advise.

I tried to do "su nagios" and my script "notify-to-keiko-chan", it worked fine,
alarm light was turn-on.
So again I tried to plug off LAN line for target host and watch event log of
Nagios.
Nagios says some HOST ALART and EVENT HANDLER messages about terget host LAN
connection, I looked following message on the event log at last;

[09-08-2005 10:18:21] SERVICE ALERT: local1-ATX135;PING;CRITICAL;HARD;1;CRITICAL
- Host Unreachable (172.17.0.150)
[09-08-2005 10:18:21] HOST EVENT HANDLER:
local1-ATX135;DOWN;HARD;10;notify-to-keiko-chan
[09-08-2005 10:18:21] HOST ALERT: local1-ATX135;DOWN;HARD;10;CRITICAL - Host
Unreachable (172.17.0.150)
[09-08-2005 10:18:18] HOST EVENT HANDLER:
local1-ATX135;DOWN;SOFT;9;notify-to-keiko-chan
[09-08-2005 10:18:18] HOST ALERT: local1-ATX135;DOWN;SOFT;9;CRITICAL - Host
Unreachable (172.17.0.150)

But alarm light didn't work. I seem to look like it has no problem about
permission of my script "notify-to-keiko-chan" and user account "nagios".

My Nagios environment is wrong for Nagios 2.0B4? Do I forget to check anything?
It's better to down grade from FC4 to FC3 for Nagios server? Please advise me.

Thank you lots of your help,


Takashi Maruyama

Aucnet Inc.
IT Department






"Sumit Malhotra" <smalhotra at dataarmor.net> 2005/09/07 18:51:30



宛先: Takashi Maruyama/A/AUCNET at AUCNET, nagios-devel at lists.sourceforge.net
cc:
件名: RE: [Nagios-devel] Behavior of event handler - doesn't work alarm light


-------------- next part --------------

I can only think of permissions issues. Try doing a su nagios and
running the same test.

/usr/local/nagios/libexec/eventhandlers/notify-to-keiko-chan DOWN HARD

Best of luck !

Thanks.
Sumit Malhotra
Data Armor


-----Original Message-----
From: nagios-devel-admin at lists.sourceforge.net
[mailto:nagios-devel-admin at lists.sourceforge.net] On Behalf Of Takashi
Maruyama
Sent: Wednesday, September 07, 2005 3:04 PM
To: nagios-devel at lists.sourceforge.net
Subject: [Nagios-devel] Behavior of event handler - doesn't work alarm
light




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





-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle
Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing &
QA
Security * Process Improvement & Measurement *
http://www.sqe.com/bsce5sf
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel




More information about the Developers mailing list