Nagios passive check not changing alert condition

Marc Powell marc at ena.com
Wed May 12 17:41:41 CEST 2004


Just some suggestions --

Enable logging of passive checks in nagios.cfg -
log_passive_service_checks=1 
Make sure that you're accepting passive checks in nagios.cfg -
accept_passive_service_checks=1 

Check nagios.log and make sure that nagios is seeing and properly
processing the passive service check. 

In the submit_check_result below, the host ($1) and service description
($2) must exactly match what nagios has in it's configs. For the
example you provide, you should be submitting something (after
substitution) like:   

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

cmdline="[timestamp]
PROCESS_SERVICE_CHECK_RESULT;TestRouter;SNMP-TRAP;1;Plugin Output"
-(example for a WARNING)  

-- 
Marc

________________________________

From: Platt, Nicholas [mailto:Nick.Platt at myflorida.com]
Sent: Wednesday, May 12, 2004 9:55 AM
To: 'nagios-users at lists.sourceforge.net'
Subject: RE: [Nagios-users] Nagios passive check not changing alert
condition 



Everyone:



Haven't received any responses so far L   If anyone can help me, please
respond.  You're help is greatly appreciated.  Thanks J 


Platt, Nicholas <mailto:Nick.Platt at myflorida.com> wrote:
> 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`








-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver
higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
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