Hi,
















I'm new at setting mon and I have a question regarding UPALERT content.
UPALERTs seem to include MON_LAST_OUTPUT instead of current monitor output.
This seems very confusing to me. I am currently only working with (my
modified) DRBD monitor so I don?t know how other monitors handle that.
Please excuse me if there is some really important reason why UPALERT should
contain last error which apparently I?ve missed, but having mon send me
current output seems to make a lot more sense :). Instead of:
















UPALERT servers/drbd: WARNING (Sun Feb 6 15:12:15)















Summary output  : WARNING












Group : servers





Service : drbd





Time noticed : Sun Feb 6 15:12:15 2011





Secs until next alert : 





Members  : localhost












Detailed text (if any) follows:





-------------------------------





[1: Connected - Primary/Secondary UpToDate/UpToDate]





[2: Connected - Secondary (should be Primary) / Primary - UpToDate/UpToDate]





[3: Connected - Primary/Secondary UpToDate/UpToDate]





[4: Connected - Primary/Secondary UpToDate/UpToDate]















(Time even contains the current monitor run ? which triggered upalert ? but
summary and text are from previous run)







I can get current status and check everything is ok:
















UPALERT servers/drbd: OK (Sun Feb 6 15:55:22)















Summary output  : OK












Group : servers





Service : drbd





Time noticed : Sun Feb 6 15:55:22 2011





Secs until next alert : 





Members  : localhost












Detailed text (if any) follows:





-------------------------------





[1: Connected - Primary/Secondary UpToDate/UpToDate]





[2: Connected - Primary/Secondary UpToDate/UpToDate]





[3: Connected - Primary/Secondary UpToDate/UpToDate]





[4: Connected - Primary/Secondary UpToDate/UpToDate]















Above output was achieved applying the following patch:
















--- mon.org 2011-02-06 15:49:52.000000000 +0100







+++ mon 2011-02-06 15:51:11.000000000 +0100







@@ -3367,7 +3367,7 @@







 {







 # Save the last failing monitor's output for posterity







 $sref->{"_upalertoutput"}=
$sref->{"_last_output"};







- do_alert ($group, $service, $sref->{"_upalertoutput"}, 0,
$FL_UPALERT);







+ do_alert ($group, $service, $output, 0, $FL_UPALERT);







 }
















 #







@@ -3375,7 +3375,7 @@







 #







 elsif (defined($sref->{"_upalert"}) && $old_status ==
$STAT_FAIL)







 {







- do_alert ($group, $service, $sref->{"_upalertoutput"}, 0,
$FL_UPALERT);







+ do_alert ($group, $service, $output, 0, $FL_UPALERT);







 }
















 $sref->{"_ack"} = 0;
















Best regards,
















gulikoza








_______________________________________________
mon mailing list
mon@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/mon

Reply via email to