Minor fix - qpage + Nagios dropping notifications

C. Bensend benny at bennyvision.com
Wed Aug 27 20:23:13 CEST 2003


Hey folks,

   For a while now, I've been tracking an elusive little problem with
Nagios and qpage.  For some reason, some critical alerts were getting
dropped in the bit-bucket.  Even more vexxing, the recoveries would
go out just fine.

   For the record, this is Nagios 1.1 and qpage 3.3 on OpenBSD 3.3-STABLE.
I have qpage implemented as follows:

        command_line    /home/nagios/libexec/qpage-wrapper -P
"$CONTACTNAME$" -f "HOSTNAME" "$HOSTNAME$ " "$SERVICEDESC$
$SERVICESTATE$:" "$NOTIFICATIONTYPE$"
"$OUTPUT$"

   (qpage-wrapper is nothing but a script to log each parameter, before
passing the entire thing on to qpage - no other functionality)

   Certain criticals would show up in the logs as Nagios handed them off
to qpage, but then they'd disappear.  Qpage would never send out the page,
nor would it log anything.  So, I suppose this could be a silent failure
of qpage as well.

   Regardless, the following quick E-Z patch fixed things right up - it
seems that qpage was having issues with the parentheses Nagios was
spitting out for service check timeouts.  Here's the patch:

--- base/utils.c.orig   Wed Aug 13 14:44:14 2003
+++ base/utils.c        Wed Aug 13 14:39:49 2003
@@ -1700,7 +1700,7 @@
 void service_check_sighandler(int sig){

        /* write plugin check results to message queue */
-       strncpy(svc_msg.output,"(Service Check Timed
Out)",sizeof(svc_msg.output)-1);
+       strncpy(svc_msg.output," Service Check Timed Out
",sizeof(svc_msg.output)-1);
        svc_msg.output[sizeof(svc_msg.output)-1]='\x0';
        svc_msg.return_code=STATE_CRITICAL;
        svc_msg.exited_ok=TRUE;

   All I did was replace the right and left parens with a space, and I'm
suddenly getting all of my alerts now.  I've been running like this for
over a week.

   I just wanted to get this in the archive for future use, in case
others have a problem with Nagios and qpage.

Benny


-- 
Outlook, the exploding Pinto on the information superhighway.
                                   --Sean Donelan


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf




More information about the Developers mailing list