[Xymon] email add-on other than html_mail.pl?
Fabian Wendlandt
fabian.wendlandt at innowerk-it.de
Tue Mar 24 20:45:25 CET 2020
Hi,
alerts.cfg invokes any script with the string specified after the script path as parameter.
>From the man page:
SCRIPT /path/to/script recipientID Recipient that invokes a script. This takes two parameters: The script filename, and the recipient that gets passed to the script.
I see no reason why receipientID could not contain a list of recipient, although you'd probably have to put some logic into your script to split/parse them, something like this:
In your alerts.cfg:
##########
SCRIPT /path/to/script.sh 'mail1 at domain.com;mail2 at domain.com'
##########
In the script:
###########
#/bin/bash
IFS=";"
recipients="$1"
for r in "$recipients"; do
send-stuff-to "$r"
done
##########
Good luck with escaping the Teams webhook URIs, though :)
Best regards,
Fabian Wendlandt
-----Ursprüngliche Nachricht-----
Von: Ribeiro, Glauber <glauber.ribeiro at experian.com>
Gesendet: Dienstag, 24. März 2020 20:26
An: Fabian Wendlandt <fabian.wendlandt at innowerk-it.de>; 'Becker Christian' <christian.becker at rhein-zeitung.net>
Cc: xymon at xymon.com
Betreff: RE: email add-on other than html_mail.pl?
I didn't know about this script. Thanks. I was about to write something similar, but what has always stopped me is that it seems (from the documentation) that for script alert rules, Xymon supports only one recipient. It my reading correct?
We use macros like
PAGER_GROUP = email1 at domain.com email2 at domain.com email3 at domain.com
And that works great for the MAIL rules.
How would a SCRIPT rule handle this? Would the script be called multiple times?
Thanks again,
Glauber
(sorry if my email shows up as an attachment - I'm still trying to figure out what is causing this)
More information about the Xymon
mailing list