[Xymon] Email with group or subgroup in subject or body

Adam Thorn alt36 at cam.ac.uk
Tue Feb 8 10:47:20 CET 2022


On 07/02/2022 14:28, Neal, Jonathan W via Xymon wrote:
> Is there any way to get the group or subgroup from hosts.cfg where the 
> host appears into the subject line or the body of the email that is sent 
> on an alert?

In general, if you want to send a custom email alert you need to look at 
using a custom SCRIPT as the alert recipient (rather than "MAIL"):

https://xymon.sourceforge.io/xymon/help/manpages/man5/alerts.cfg.5.html

and there was an example of using a custom script posted to list a while 
ago:

http://krisspringer.net/posts/xymon-email-alerts.php

The final section in that man page ("Alert scripts") lists the variables 
automatically available to an alert script. This doesn't include any 
info about the page, subpage etc where a host is listed in hosts.cfg - 
note that that might not be uniquely defined, as a host can appear 
multiple times in hosts.cfg.

A custom script could in principle look up extra information via e.g. an 
external xymondboard query but I'm not aware of any xymon tool which 
will tell you "on which page(s) in host.cfg can I find host X?". (I 
guess one could grep through the html tree of files generated by 
xymongen .. (!) )

Adam


More information about the Xymon mailing list