[Xymon] Create an Alert that Staggers Script Execution

J.C. Cleaver cleaver at terabithia.org
Tue Jan 19 22:56:37 CET 2016


On Sat, January 16, 2016 6:37 pm, Kyle Bassett wrote:
> Hi all, happy 2016 ;-)
>
> I'm trying to configure my alerts to trigger different scripts based on
> how
> long the host has been offline.  I can write up something outside of
> xymon,
> but I figured someone might have a more elegant solution.
>
> If I do not specify a DURATION, xymon will trigger the multiple scripts.
> With a DURATION defined, xymon will only trigger the lowest specified
> DURATION (in the following example, the first "immediate" script).
>
> Does anyone have thoughts on how to trigger the scripts in a staggered
> fashion?
>
>
> Example hobbit-alerts.cfg
> HOST=apple SERVICE=conn
>     SCRIPT alert_group1.sh 123456 REPEAT=8h RECOVERED   #immediate
>     SCRIPT alert_group2.sh 123456 REPEAT=1h DURATION>1 RECOVERED   #1min
>     SCRIPT alert_group3.sh 123456 REPEAT=1h DURATION>3 RECOVERED   #3min
>

I suspect this is a function of how xymond_alert handles recipient
coalescing generally, which was more around host + test +
email/recipientaddress de-duplication and less about the "transmission
method", the ostensible intent of the 'SCRIPT' framework. Without a
DURATION delay, we seem to be taking a different path that doesn't result
in a repeat record being created.

This suggests that a quick workaround for this would be to change the
"123456" on the various lines to distinct values; they should all be
handled and tracked independently.

With a single recipient, the coalescing seems like it should be being
performed regardless of DURATION and just involve the REPEAT frequency,
assuming the host+test+recip triplet is identical. That seems like bug #1.

It also brings up the larger question of if the 'SCRIPT' name (just
basename?) should be considered part of the identifier and treated
distinctly. That would seem to make more sense, but I can imagine cases
where this feature might be used by those with more complex
configurations.


Thoughts and suggestions on this welcome...

Regards,
-jc




More information about the Xymon mailing list