Dear Folks, Please would someone help me out with what may be a bug in global event handlers in 3.0 alpha (not rc1 or 2 since there is nothing in the Changelog that seems to warrant upgrade) ?
I have a (gloal host) event handler called like so command_line $USER2$/global_host_event_handler $HOSTNAME$ $HOSTSTATE$ $HOSTSTATETYPE$ $LASTHOSTUP$ $LASTHOSTDOWN$ $LASTHOSTUNREACHABLE$ $HOSTDOWNTIME$ I expect that $LASTHOSTUP$ when $HOSTSTATE$ eq UP and $HOSTSTATETYPE eq HARD, to be the time the handler was called, and $LASTHOSTDOWN$ to contain, generally, the time that the host was detected in a (hard) down state. Right so far ? The Nagios logs show records like so [EMAIL PROTECTED] nagios]$ tail -500 nagios.log | perl -lne 'print if /Hobart/ && /EVENT|HARD/ && !/SERV/' | ./ns-time_t2localtime Sat Feb 9 03:13:39 2008 GLOBAL HOST EVENT HANDLER: Hobart;(null);(null);(null);global_host_event_handler Sat Feb 9 03:13:59 2008 GLOBAL HOST EVENT HANDLER: Hobart;(null);(null);(null);global_host_event_handler Sat Feb 9 03:15:19 2008 GLOBAL HOST EVENT HANDLER: Hobart;(null);(null);(null);global_host_event_handler Sat Feb 9 03:16:39 2008 GLOBAL HOST EVENT HANDLER: Hobart;(null);(null);(null);global_host_event_handler Sat Feb 9 03:17:59 2008 GLOBAL HOST EVENT HANDLER: Hobart;(null);(null);(null);global_host_event_handler Sat Feb 9 03:19:19 2008 GLOBAL HOST EVENT HANDLER: Hobart;(null);(null);(null);global_host_event_handler Sat Feb 9 03:20:39 2008 GLOBAL HOST EVENT HANDLER: Hobart;(null);(null);(null);global_host_event_handler Sat Feb 9 03:21:59 2008 GLOBAL HOST EVENT HANDLER: Hobart;(null);(null);(null);global_host_event_handler Sat Feb 9 03:23:19 2008 GLOBAL HOST EVENT HANDLER: Hobart;(null);(null);(null);global_host_event_handler Sat Feb 9 03:24:39 2008 HOST ALERT: Hobart;DOWN;HARD;10;CRITICAL - Plugin timed out after 10 seconds Sat Feb 9 03:24:39 2008 GLOBAL HOST EVENT HANDLER: Hobart;(null);(null);(null);global_host_event_handler Sat Feb 9 06:48:49 2008 HOST ALERT: Hobart;UP;HARD;1;PING OK - Packet loss = 0%, RTA = 32.19 ms Sat Feb 9 06:48:49 2008 GLOBAL HOST EVENT HANDLER: Hobart;(null);(null);(null);global_host_event_handler but in 3.0alpha, the event handlers arguments have these values (dumped by the handler when it's called) Sat Feb 9 06:48:49 2008 : Hobart UP HARD 1202500129 1202499949 1200659464 0 or in localtime format, [EMAIL PROTECTED] nagios]$ perl -le 'print join " ", map { localtime($_) . "" } qw(1202500129 1202499949 1200659464)' Sat Feb 9 06:48:49 2008 Sat Feb 9 06:45:49 2008 Fri Jan 18 23:31:04 2008 ie the $LASTHOSTDOWN$ is 06:45:49 instead of 03:3:39 !! The event handler is perhaps foolish to rely on the macros, but what is wrong here ? Is it the macro value ? Is it the event handler call from Nagios ? Is it something that needs fixing before a 3.0 release ? I am sure this behaviour is different to that in 2.9 since I was using this event handler with only minor changes thruought the 2.x series and producing reports from that data each month (for about 18 months). The docco for 3.x LASTHOST macros is, as far as I can tell, exactly the same as for 2.x, so this appears to be an undocumented (and unwelcome) change. Any comments or suggestions are welcome. >From my point of view, I will have to rewrite an event handler that worked fine with 2.9 since this stuff is VITAL to my availability reporting. Thank you, Yours sincerely. Classification: UNCLASSIFIED Dear Folks, Please would someone help me out with what may be a bug in global event handlers in 3.0 alpha (not rc1 or 2 since there is nothing in the Changelog that seems to warrant upgrade) ? I have a (gloal host) event handler called like so command_line $USER2$/global_host_event_handler $HOSTNAME$ $HOSTSTATE$ $HOSTSTATETYPE$ $LASTHOSTUP$ $LASTHOSTDOWN$ $LASTHOSTUNREACHABLE$ $HOSTDOWNTIME$ I expect that $LASTHOSTUP$ when $HOSTSTATE$ eq UP and $HOSTSTATETYPE eq HARD, to be the time the handler was called, and $LASTHOSTDOWN$ to contain, generally, the time that the host was detected in a (hard) down state. Right so far ? The Nagios logs show records like so [EMAIL PROTECTED] nagios]$ tail -500 nagios.log | perl -lne 'print if /Hobart/ && /EVENT|HARD/ && !/SERV/' | ./ns-time_t2localtime Sat Feb 9 03:13:39 2008 GLOBAL HOST EVENT HANDLER: Hobart;(null);(null);(null);global_host_event_handler Sat Feb 9 03:13:59 2008 GLOBAL HOST EVENT HANDLER: Hobart;(null);(null);(null);global_host_event_handler Sat Feb 9 03:15:19 2008 GLOBAL HOST EVENT HANDLER: Hobart;(null);(null);(null);global_host_event_handler Sat Feb 9 03:16:39 2008 GLOBAL HOST EVENT HANDLER: Hobart;(null);(null);(null);global_host_event_handler Sat Feb 9 03:17:59 2008 GLOBAL HOST EVENT HANDLER: Hobart;(null);(null);(null);global_host_event_handler Sat Feb 9 03:19:19 2008 GLOBAL HOST EVENT HANDLER: Hobart;(null);(null);(null);global_host_event_handler Sat Feb 9 03:20:39 2008 GLOBAL HOST EVENT HANDLER: Hobart;(null);(null);(null);global_host_event_handler Sat Feb 9 03:21:59 2008 GLOBAL HOST EVENT HANDLER: Hobart;(null);(null);(null);global_host_event_handler Sat Feb 9 03:23:19 2008 GLOBAL HOST EVENT HANDLER: Hobart;(null);(null);(null);global_host_event_handler Sat Feb 9 03:24:39 2008 HOST ALERT: Hobart;DOWN;HARD;10;CRITICAL - Plugin timed out after 10 seconds Sat Feb 9 03:24:39 2008 GLOBAL HOST EVENT HANDLER: Hobart;(null);(null);(null);global_host_event_handler Sat Feb 9 06:48:49 2008 HOST ALERT: Hobart;UP;HARD;1;PING OK - Packet loss = 0%, RTA = 32.19 ms Sat Feb 9 06:48:49 2008 GLOBAL HOST EVENT HANDLER: Hobart;(null);(null);(null);global_host_event_handler but in 3.0alpha, the event handlers arguments have these values (dumped by the handler when it's called) Sat Feb 9 06:48:49 2008 : Hobart UP HARD 1202500129 1202499949 1200659464 0 or in localtime format, [EMAIL PROTECTED] nagios]$ perl -le 'print join " ", map { localtime($_) . "" } qw(1202500129 1202499949 1200659464)' Sat Feb 9 06:48:49 2008 Sat Feb 9 06:45:49 2008 Fri Jan 18 23:31:04 2008 ie the $LASTHOSTDOWN$ is 06:45:49 instead of 03:3:39 !! The event handler is perhaps foolish to rely on the macros, but what is wrong here ? Is it the macro value ? Is it the event handler call from Nagios ? Is it something that needs fixing before a 3.0 release ? I am sure this behaviour is different to that in 2.9 since I was using this event handler with only minor changes thruought the 2.x series and producing reports from that data each month (for about 18 months). The docco for 3.x LASTHOST macros is, as far as I can tell, exactly the same as for 2.x, so this appears to be an undocumented (and unwelcome) change. Any comments or suggestions are welcome. >From my point of view, I will have to rewrite an event handler that worked fine with 2.9 since this stuff is VITAL to my availability reporting. Thank you, Yours sincerely. Classification: UNCLASSIFIED ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Nagios-users mailing list Nagios-users@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