Missing $NOTIFICATIONUMBER$ macro

Jeff Orr jorr at attributor.com
Tue Aug 21 23:49:05 CEST 2007


Thanks for the quick response.$SERVICEATTEMPT$ isn't quite what I need. I need the first two notifications sent for this wrapper to be WARNINGs iff check_nrpe encountered a socket timeout. Each following timeout should generate a CRITICAL notification. 

Maybe I'm approaching this problem from the wrong angle.

Jeff Orr
Attributor Corporation


----- Original Message -----
From: "Marc Powell" <marc at ena.com>
To: "nagios-users" <nagios-users at lists.sourceforge.net>
Sent: Tuesday, August 21, 2007 2:40:05 PM (GMT-0800) America/Los_Angeles
Subject: Re: [Nagios-users] Missing $NOTIFICATIONUMBER$ macro



> -----Original Message-----
> From: nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-
> bounces at lists.sourceforge.net] On Behalf Of Jeff Orr
> Sent: Tuesday, August 21, 2007 4:25 PM
> To: nagios-users
> Subject: [Nagios-users] Missing $NOTIFICATIONUMBER$ macro
> 
> I have an odd problem with Nagios 2.9 and NRPE 2.8x. I'm wrapping
> check_nrpe in a script to detect socket timeouts; the script returns a
> WARNING instead of an UNKNOWN for the first two socket timeouts, and a
> CRITICAL thereafter. I'm using $NOTIFICATIONNUMBER$ to pass in the
current
> notification count.
> 
> The problem is that $NOTIFICATIONNUMBER$ does not seem to be being
passed
> to me script. Here is what I have in checkcommands.cfg, in which
> $NOTIFICATIONNUMBER$ gives a null value in my PERL script:
>
> define command{
>  command_name check__data_disk2
>  command_line $USER1$/nrpe_wrapper -H $HOSTADDRESS$ -c check_disk3 -S
> $SERVICESTATE$ -N $NOTIFICATIONNUMBER$
> }

$NOTIFICATIONNUMBER$ isn't valid for host/service check commands, only
notifications (http://nagios.sourceforge.net/docs/2_0/macros.html).
Unless the above command is being called as a notification command, and
it would be very unusual if it was, it's not going to work.

> Now $notificationcount gets set to '30'. Any pointers on what I can
try to
> get the notification # into my plugin? Nagios was compiled with all
the
> standard options to ./configure.

I suspect that what you're really looking for is $SERVICEATTEMPT$. Check
the macros page to be sure.

--
Marc


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
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