I'd like to configure Monit to deliver 'fail' and 'success' notifications via its alerting system; the global alerting system seems only to support email notifications, and there doesn't seem to be a way to configure 'if alert, do this; on recovery, do that' type of logic.
I'm new to Monit; is my understanding correct?
What I need to be able to do is to signal my monitoring system, preferably via an HTTP endpoint, on success/fail events.
I can do this individually via 'program' checks that provide a return code that can be used to trigger an external script; I'd prefer to do this globally, however, so that I can configure a single 'alert' that applies to all services.
The alert would then communicate a binary 'success' or 'fail' message with a payload identifying the problem (in the case of alerts).
Is that functionality possible in Monit?
I've been trying to find a way to implement what I've described but have not been able to.
UPDATE 2020-06-07 I think I’m might not be explaining the problem correctly.
The basic idea is that I want a single “check” on each server that tells me whether or not any Monit services are in a “down” state. I use a third-party service to monitor that “check” (think Cronitor).
I was able to automate this with a shell script and a cron job by evaluating the output of monit report
and it’s working pretty well; I was initially attempting to do this in Monit (trying to get it to alert to an HTTP endpoint with this basic check, versus sending an email) but I was unable to find a way.