Nagios passive check not changing alert condition

Platt, Nicholas Nick.Platt at myflorida.com
Tue May 11 17:55:54 CEST 2004


 

 

Hellow everyone:

 

I've been able to get SNMPTT to accept a trap and pass it to
"submit_check_result" script but Nagios is not changing the passive service
object to warning condition.  I've executed the "submit_check_result"
manually and could not get Nagios to change the service object from Okay to
Warning:

 

[root at nagios eventhandlers]# ./submit_check_result TestRouter TRAP 1
"Ethernet down test"

 

 

Can someone look at my service object and see if I have anything
mis-configured?  I am able to perform all external commands but I just can't
get nagios.cmd to execute and cause a passive check to change from green to
yellow.   I was able to output the results of the "submit_check_results" and
found that it was spitting out the right output.  See blow for script.   Any
help will be greatly appreciated

 

 

**************************SERVICE***********************

define service{

        use                             generic-service

        host_name                       TestRouter

        service_description             SNMP-TRAP

        is_volatile                     1

        passive_checks_enabled          1

        check_period                    none

        max_check_attempts              1

        normal_check_interval           1

        retry_check_interval            1

        contact_groups                  network-admins

        notification_interval           31536000

        notifications_enabled           1

        notification_period             24x7

        notification_options            w,c,u,r

        check_command                   check-host-alive

        }

 

 

*************HOST**************

define host{

        use                     generic-host            ; Name of host
template to use

        host_name               TestRouter

        alias                   LAB Cisco 800

        address                 192.168.1.1        

        parents                 M1

        check_command           check-host-alive

        max_check_attempts      3

        low_flap_threshold      25

        high_flap_threshold     50

        flap_detection_enabled  1

        notification_interval   60

        notification_period     24x7

        notification_options    d,u,r

        }

 

************************submit_check_results*************************

#!/bin/sh

 

# SUBMIT_CHECK_RESULT

# 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"

 

CommandFile="/usr/local/nagios/var/rw/nagios.cmd"

 

# 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 >> $CommandFile`

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20040511/e8e87950/attachment.html>


More information about the Users mailing list