Event handlers not executing - Nagios 1.05b

C. Bensend benny at bennyvision.com
Tue Sep 24 04:40:14 CEST 2002


Hey folks,

	I'm having a problem with a test installation of
Nagios 1.05b.  It doesn't appear to be executing a custom
event handler that I have defined.

nagios.cfg:

log_event_handlers=1
enable_event_handlers=1

misccommands.cfg:

# 'qwest-event' command definition
define command{
        command_name    qwest-event
        command_line    $USER1$/qwest-event
}

hosts.cfg:

define host{
        use                     generic-host
        host_name               myrouter
        parents                 routerparent
        event_handler_enabled   1
        event_handler           qwest-event
        alias                   Router
        address                 216.161.x.y
        check_command           check-host-alive
        max_check_attempts      10
        notification_interval   120
        notification_period     24x7
        notification_options    d,u,r
        }

	I am seeing several events a day, where this router
becomes unreachable, but the event handler is not executing.
I have made sure that it is executable via the nagios user,
and can write to the directory in the event handler:


#!/bin/bash

# Script to document Qwest's routing problems
# To be used with Nagios - as an event handler, it can track these
# events automagically
#
# Benny, 9-2002

# What host are we tracing the route to?
TARGET="216.161.x.y"

# Where is the traceroute binary?
TRACEROUTE="/usr/sbin/traceroute"

# What options do we want for traceroute?
TRACEROUTEOPT="-m 18 -n"

# Where do you want to dump the traces?
LOGFILEDIR="/home/nagios/qwest/"

# What date format do you want to use for the traces?
# Default:  09-08-2002_16:42:32 (M-D-Y_H:M:S)
DATEFORMAT="+%m-%d-%Y_%H:%M:%S"

export TARGET TRACEROUTE TRACEROUTEOPT LOGFILEDIR DATEFORMAT

# For debugging purposes
#echo "${TRACEROUTE} ${TRACEROUTEOPT} ${TARGET} > ${LOGFILEDIR}`date
${DATEFORMAT}`"
DATE=`date ${DATEFORMAT}` ; export DATE
echo "" > ${LOGFILEDIR}${DATE}
echo `date ${DATEFORMAT}` >> ${LOGFILEDIR}${DATE}
${TRACEROUTE} ${TRACEROUTEOPT} ${TARGET} >>  \
        ${LOGFILEDIR}${DATE}
echo "" >> ${LOGFILEDIR}${DATE}


	Any thoughts, folks?  I would very much appreciate any
hints.

Thanks!

Benny


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"Now, to unleash screaming temporal doom!"
--- Invader Zim




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf




More information about the Users mailing list