[Mon-devel] No summary for upalert events
Brought to you by:
trockij
From: Todd L. <tl...@iv...> - 2005-12-19 21:55:27
|
Hi, I've been tracking down an empty upalert problem and think I've found it. I have a question though. This is using cvs 1.1.0-pre2 of mon/mon. In sub process_event(), if the monitor script exits with any value, it sends an alert on line 3250: do_alert ($group, $service, $output, $exitval, $FL_MONITOR); If the script exits with an exit value of 0, then it sends an alert on line 3315: do_alert ($group, $service, $sref->{"_upalertoutput"}, 0, $FL_UPALERT); The hashref $sref->{"_upalertoutput"} is not defined anywhere in the code that I can find. It seems that there should be something like: $sref->{"_upalertoutput"} = $output; The following patch works for me, but without a deeper understanding of the code, I like to have someone with mon internals experience tell me if I'm doing it the right way, or if it should just be passing $output to the do_alert() function, or if there is something else going on that I'm not seeing. --- /usr/sbin/mon.orig 2005-12-19 13:51:41.000000000 -0800 +++ /usr/sbin/mon 2005-12-19 13:47:22.000000000 -0800 @@ -3332,6 +3332,8 @@ my $old_status = $sref->{"_op_status"}; set_op_status ($group, $service, $STAT_OK); + $sref->{"_upalertoutput"} = $output; + if ($type eq "t") { $sref->{"_last_uptrap"} = $tmnow; @@ -3350,6 +3352,7 @@ || (($tmnow - $sref->{"_first_failure"}) >= $sref->{"upalertafter"})))) { do_alert ($group, $service, $sref->{"_upalertoutput"}, 0, $FL_UPALERT); + do_alert ($group, $service, $sref->{"_upalertoutput"}, 0, $FL_UPALERT); } # -- Regards... Todd we're off on the usual strange tangents. next will be whether it is ethical to walk in your neighbor's open house if they're running ipv6:-). --Randy Bush Linux kernel 2.6.12-12mdksmp 2 users, load average: 1.57, 1.42, 1.30 |