On 12/2/24 7:47 PM, Jeremy Laidman wrote:
I think Adam's solution is probably the best fit for your needs.
I guess I did something wrong as when I tested Adam's solution I wasn't able to get things to work as well as they were before. So I reverted. I assume that I did something wrong.
However, if you need a bit more flexibility ..., there may be ... another solution. You can use the "xymond_channel" binary to tap into the "stachg" ... channel, filtering for any event that changes colour from red to blue or from blue to red .... The following command waits for such events, and for each it spits out the associated status message that you might use in an email message:
$ sudo -u xymon xymoncmd xymond_channel --channel=stachg --metafilter='\|(blue\|red|red\|blue)\|' cat
My initial testing of this has been very promising. I'll be greenfielding some code to receive the data from the channel and send emails that I need.
There might be a way to redirect this output back into to Xymon on the "page" channel, which then allows your existing alerts.cfg configuration to be used for managing your emails in the same way you would for red alerts, etc. However I suspect there will be limited features (eg there isn't a DELAYBLUE option) or work-arounds required (eg specifying a colour of "!red,!yellow,!purple" to match "blue" events?)
For now I just need to send a helper email to ServiceNow when a test goes from blue to green; as if Disable until OK was chosen.
-- Grant. . . . unix || die