xymond_alert / alerts.cfg duration bugs or documentation issues
list Sebastian Auriol
2 possible bugs or documentation errors...
Summary:
1. xymond_alert interprets duration as minutes although the documentation
says it is specified as seconds.
2. > is interpreted as >= (greater than or equal to) instead of > (greater
than) in alerts.cfg.
Version affected:
4.3.7
Steps to reproduce:
alerts.cfg:
HOST=CS1
MAIL $pg-sebsms SERVICE=svcs COLOR=red DURATION>10m REPEAT=30 RECOVERED
Also tried without the the m for minutes, as this is supposed to be the
default.
/home/hobbit/server/bin/xymond_alert --test CS1 svcs --color=red
--duration=11 | grep Mail
00009396 2012-05-28 14:09:46 Mail alert with command '/var/spool/mail/root
"Xymon [12345] CS1:svcs CRITICAL (RED)" <mailto:user-d5c48cad14eb@xymon.invalid'>
<email address removed>' <mailto:user-d5c48cad14eb@xymon.invalid'>
/home/hobbit/server/bin/xymond_alert --test CS1 svcs --color=red
--duration=10 | grep Mail
00009483 2012-05-28 14:09:50 Mail alert with command '/var/spool/mail/root
"Xymon [12345] CS1:svcs CRITICAL (RED)" <mailto:user-d5c48cad14eb@xymon.invalid'>
<email address removed>' <mailto:user-d5c48cad14eb@xymon.invalid'>
/home/hobbit/server/bin/xymond_alert --test CS1 svcs --color=red
--duration=9 | grep Mail
<nothing>
But man xymond_alert says:
--duration=SECONDS The SECONDS parameter is the duration of the alert in
seconds.
However, as you can see above, the xymond_alert parameter is behaving as if
it was in minutes (or the alerts.cfg rule is behaving as if it was in
seconds). And the > is behaving as if it were >=.
Expected behaviour:
1. xymond_alert interprets duration as seconds.
2. > is interpreted as > (greater than) in alerts.cfg.
Other Suggestion:
alerts.cfg should accept durations specified in seconds (with an s suffix)
so that alert parameters can be more accurately defined as some tests or
status changes may be occurring more often than once a minute.
Kind regards,
SebA
list Henrik Størner
▸
On 28-05-2012 15:28, SebA wrote:
2 possible bugs or documentation errors... *Summary:* 1. xymond_alert interprets duration as minutes although the documentation says it is specified as seconds.
Right, I'll correct the documentation so it is clear that the duration values are in minutes (in 4.3.9).
▸
2. > is interpreted as >= (greater than or equal to) instead of > (greater than) in alerts.cfg.
Fixed in 4.3.9, so you can explicitly use ">=" or "<=" instead of ">" and "<" behaving as such (you cannot actually specify ">=" in 4.3.x versions prior to 4.3.9).
▸
*Other Suggestion:* alerts.cfg should accept durations specified in seconds (with an s suffix) so that alert parameters can be more accurately defined as some tests or status changes may be occurring more often than once a minute.
Not really meaningful, IMHO. Also, the alert handler only polls for new alerts every 30 seconds so it would increase the load significantly if we had to support per-second alerts. Regards, Henrik
list Sebastian Auriol
OK, thank you Henrik!
▸
-----Original Message----- From: xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com] On Behalf Of Henrik Størner Sent: 24 July 2012 17:28 To: xymon at xymon.com Subject: Re: [Xymon] xymond_alert / alerts.cfg duration bugs or documentation issues On 28-05-2012 15:28, SebA wrote:2 possible bugs or documentation errors... *Summary:* 1. xymond_alert interprets duration as minutes although the documentation says it is specified as seconds.Right, I'll correct the documentation so it is clear that the duration values are in minutes (in 4.3.9).2. > is interpreted as >= (greater than or equal to) instead of > (greater than) in alerts.cfg.Fixed in 4.3.9, so you can explicitly use ">=" or "<=" instead of ">" and "<" behaving as such (you cannot actually specify ">=" in 4.3.x versions prior to 4.3.9).*Other Suggestion:* alerts.cfg should accept durations specified in seconds (with an s suffix) so that alert parameters can be more accurately defined as some tests or status changes may be occurring more often than once a minute.Not really meaningful, IMHO. Also, the alert handler only polls for new alerts every 30 seconds so it would increase the load significantly if we had to support per-second alerts. Regards, Henrik