[Xymon] Ordering of yellow vs. red messages in <hostname>:msgs alert e-mails

Adam Thorn alt36 at cam.ac.uk
Sat Dec 30 12:23:00 CET 2023


On 29/12/2023 18:59, Greg Earle wrote:

> I keep having to scroll down through all the "&yellow" alerts I don't 
> really care much about to get down to the "&red" ones I do care about.
> 
> Is there some knob somewhere I can twiddle to get the ordering reversed; 
> i.e. to have the &red ones appear first at the top, before all the 
> &yellow ones?  A quick scan through the *.cfg files didn't turn up any 
> likely candidates.

The contents of the alert emails are the same as the status messages 
sent to the xymon server. Thus, the ordering of the lines is defined by 
whatever generates the status message.

I've never seen a config option to implement custom line ordering in 
either the 'msgs' or any other test, but if all you care about is the 
order of the lines in the alert emails (and not the status messages as 
reported by xymon itself) you could use a custom SCRIPT as the alert 
receipient rather than MAIL in alerts.cfg, e.g.

SERVICE=msgs COLOR=red SCRIPT=/my/custom/alert-msgs-script.sh 
alerts at example.com

and have that alert-msgs-script.sh send whatever message you want to 
RCPT (i.e. alerts at example.com in this example). See man alerts.cfg; the 
SCRIPT will have a number of environment variables available including 
BBALPHAMSG containing the full status text, which you could 
process/sort/rearrage as you wish and then have the SCRIPT send a mail.

Adam


More information about the Xymon mailing list