It's complicated but you are going to have to find an external way to keep track of your notifications for a given service and reference that from your plugin. You will probably need to change your notification script to write to a db (or even a flat file) which can then be looked at by your plugin.
My thought would be a simple db structure something like host_name, service_name, notification_number. Have your notifcation script update the notification_number each time it sends a notification. Your plugin would have to reset this value to 0 if the service is ok. Your plugin will have to know how to pull this data from the db so you would not use the $NOTIFICAITONNUMBER$ macro, your script will have it's own variable. If you are using NDOUtils, you might be able to use exsiting data instead of the additional db(not running it yet so I don't know for sure). This is a little oversimplified but I think this is how you could do it. Chris Waters Technology Services - Network Group JELD-WEN, Inc. Information Systems [EMAIL PROTECTED] -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Orr Sent: Tuesday, August 21, 2007 2: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$ } At first I thought it was a problem with my code, or with GetOpt. So I changed it to this: define command{ command_name check__data_disk2 command_line $USER1$/nrpe_wrapper -H $HOSTADDRESS$ -c check_disk3 -S $SERVICESTATE$ -N 30$NOTIFICATIONNUMBER$ } 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. Thanks, Jeff Orr Attributor Corporation ------------------------------------------------------------------------ - 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 [email protected] 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 ------------------------------------------------------------------------- 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 [email protected] 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
