[Xymon] BBCOLORLEVEL environment variable wrong on RECOVERED alerts via SCRIPT

Axel Beckert abe at deuxchevaux.org
Tue May 21 14:57:29 CEST 2019


Hi,

I have implemented sending alerts to Telegram via the SCRIPT keyword
in alerts.cfg. My wrapper script looks as follows:

----------------------------------------------------------------------
#!/bin/sh
# See https://www.xymon.com/help/xymon-alerts.html#scripts

printf "$BBHOSTSVC is $BBCOLORLEVEL:\n\n$BBALPHAMSG" | /usr/local/bin/telegram-bot-send-to $RCPT
----------------------------------------------------------------------

Both, the wrapper script as well as the generic script are available
on https://github.com/xtaran/telegram-bot-send-to (work in progress)

I currently have the following issues with that:

The BBCOLORLEVEL variable seems always wrong on "RECOVERED" alerts,
e.g. look at these two messages:

--- Message from Xymon Bot on Sym, [21.05.19 06:43] ---
someone.cpu is yellow:

yellow Tue May 21 06:41:30 CEST 2019 up: 67 days, 2 users, 127 procs, load=2.49
&yellow Load is HIGH
System clock is 0 seconds off


top - 06:41:41 up 67 days,  5:54,  2 users,  load average: 1.03, 2.49, 2.75
Tasks: 127 total,   2 running, 125 sleeping,   0 stopped,   0 zombie

--- Message from Xymon Bot on Sym, [21.05.19 06:46] ---
someone.cpu is yellow:

green Tue May 21 06:46:34 CEST 2019 up: 67 days, 2 users, 128 procs, load=1.18
System clock is 0 seconds off


top - 06:46:39 up 67 days,  5:59,  2 users,  load average: 0.90, 1.18, 2.09
Tasks: 128 total,   2 running, 126 sleeping,   0 stopped,   0 zombie

The second message says "someone.cpu is yellow" despite the next line
says "green" and the load is below 2 again and the message is actually
a RECOVERED message. (Should probably add that fact to the above
wrapper script.)

This is a pattern which I have noticed for quite some alerts. (Not
sure if it affects all alerts, but I suspect so.) So this looks like a
bug when filling these environment variables.

I ran into it with Xymon 4.3.28, but I haven't noticed any related
changes in the 4.3.29 branch, so I assume, the issue is still present.

		Kind regards, Axel
-- 
PGP: 2FF9CD59612616B5      /~\  Plain Text Ribbon Campaign, http://arc.pasp.de/
Mail: abe at deuxchevaux.org  \ /  Say No to HTML in E-Mail and Usenet
Mail+Jabber: abe at noone.org  X
https://axel.beckert.ch/   / \  I love long mails: https://email.is-not-s.ms/


More information about the Xymon mailing list