Re: UPALERT ouput

2011-02-07 Thread Jim Trocki

On Sun, 6 Feb 2011, gulikoza wrote:


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:


[... lots of newlines]



Above output was achieved applying the following patch:


- do_alert ($group, $service, $sref-gt;{quot;_upalertoutputquot;}, 0,
$FL_UPALERT);
+ do_alert ($group, $service, $output, 0, $FL_UPALERT);



sure, that's acceptable, as long as the alert script knows what to expect.

the idea for sending the previous output to the upalert script is so
you can easily send an alert that shows what error condition was fixed.

i guess another way to do it is to send both the previous and the current
output to the alert script and let it decide what to do, or to provide
a way to configure which to send to the alert.

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


OT quarantine (was Re: UPALERT ouput)

2011-02-07 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

P.S.: someone on this list has an address which quarantines *all* incoming
email.  Doing that to a mailing list is bad juju.

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]allber...@gmail.com
system administrator  [openafs,heimdal,too many hats]kf8nh
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1QQ4cACgkQIn7hlCsL25X82wCdEXB/5bhO9U0kJoA03TYgCj77
oVAAnRWgePMUVStiYq3uS26gzV6AZteP
=qmBV
-END PGP SIGNATURE-

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


Re: UPALERT ouput

2011-02-07 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 2/7/11 13:50 , Jim Trocki wrote:
 the idea for sending the previous output to the upalert script is so
 you can easily send an alert that shows what error condition was fixed.
 
 i guess another way to do it is to send both the previous and the current
 output to the alert script and let it decide what to do, or to provide
 a way to configure which to send to the alert.

I would send both... *after* fixing it not to use the environment, or to
truncate.  Most systems limit the combined size of command arguments and
environment, with the result that a monitor that emits a big enough error
message *won't send an alert* because exec()ing the alert fails with E2BIG.

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]allber...@gmail.com
system administrator  [openafs,heimdal,too many hats]kf8nh
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1QQfAACgkQIn7hlCsL25UnSwCfUMaQXz1GE+XgjbwazX2mu17F
22AAni+DaPxxAbdYfe6yU9f2neuVYVfz
=RSfW
-END PGP SIGNATURE-

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


UPALERT ouput

2011-02-06 Thread gulikoza













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.0 +0100







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







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







 {







 # Save the last failing monitor's output for posterity







 $sref-gt;{quot;_upalertoutputquot;}=
$sref-gt;{quot;_last_outputquot;};







- do_alert ($group, $service, $sref-gt;{quot;_upalertoutputquot;}, 0,
$FL_UPALERT);







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







 }
















 #







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







 #







 elsif (defined($sref-gt;{quot;_upalertquot;}) amp;amp; $old_status ==
$STAT_FAIL)







 {







- do_alert ($group, $service, $sref-gt;{quot;_upalertoutputquot;}, 0,
$FL_UPALERT);







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







 }
















 $sref-gt;{quot;_ackquot;} = 0;
















Best regards,
















gulikoza








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