(no subject)

Joshua Speer kuyote at yahoo.com
Wed Aug 25 18:43:09 CEST 2004


I am having a little trouble getting my even handlers
working. I have search the archive and haven't come
across anything that will do the trick. Here is what I
have defined in my services.cfg file

# SNMP PING Service definition
define service{
        host_name                       rt101
        service_description             snmp-ping
        max_check_attempts              3
        event_handler                   snmp-ping
        normal_check_interval           5
        retry_check_interval            1
        notification_interval           20
        notification_period             24x7
        check_command                  
check_ping!100.0,20%!500.0,60%
        }




Here is what I have for the snmp-ping even handler

#!/bin/sh

# SNMP-PING
# Written by Ethan Galstad (nagios at nagios.org)
# Last Modified: 02-18-2002
#
# This script will write a command to the Nagios
command
# file to cause Nagios to process a passive service
check
# result.  Note: This script is intended to be run on
the
# same host that is running Nagios.  If you want to 
# submit passive check results from a remote machine,
look
# at using the nsca addon.
#
# Arguments:
#  $1 = host_name (Short name of host that the service
is
#       associated with)
#  $2 = svc_description (Description of the service)
#  $3 = return_code (An integer that determines the
state
#       of the service check, 0=OK, 1=WARNING,
2=CRITICAL,
#       3=UNKNOWN).
#  $4 = plugin_output (A text string that should be
used
#       as the plugin output for the service check)
# 
 
echocmd="/bin/echo"

 

OutputFile="/usr/local/nagios/var/rw/output.file"

 

# get the current date/time in seconds since UNIX
epoch

datetime=`date +%s`

 

# create the command line to add to the command file

cmdline="[$datetime]
PROCESS_SERVICE_CHECK_RESULT;$1;$2;$3;$4"

 

# append the command to the end of the command file

`$echocmd $cmdline >> $OutputFile`

`$echocmd $cmdline >> /backup/snmp-trap-test.log`


I am just trying to get it to write to either file,
but it never does. If I it from command line it works
fine. Also I have taken this device offline, to test
but that doesn't work either.

Thanks,

Josh






		
__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail


-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
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