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 'user-c59f6a86ca59@xymon.invalid;user-b7e4b603598a@xymon.invalid'
##########
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 <user-59d088777028@xymon.invalid>
Gesendet: Dienstag, 24. M?rz 2020 20:26
An: Fabian Wendlandt <user-a63c2f5e765a@xymon.invalid>; 'Becker Christian' <user-e4a19bfb94c0@xymon.invalid>
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 = user-89ededacf16f@xymon.invalid user-8716922fe3cf@xymon.invalid user-e2b4d8be0765@xymon.invalid
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)