how can I set alert for different cycles fails to different users (something like that) for the same service in monit?
I have tried the config like his below.
check host "Cluster0 Admin Panel" with address 192.168.5.80
if failed port 4443 protocol https with timeout 10 seconds for 3 cycles then alert [email protected]
if failed port 4443 protocol https with timeout 10 seconds then alert [email protected]
But syntax error occured on the e-mail addresses lines.
this one sent emails to both user at 1th cycle and 3th cycle
check host "Cluster0 Admin Panel" with address 192.168.5.80
if failed port 4443 protocol https with timeout 10 seconds for 3 cycles then alert
alert [email protected]
if failed port 4443 protocol https with timeout 10 seconds then alert
alert [email protected]
This is the way how Monit handle the alert statement, see https://mmonit.com/monit/documentation/monit.html#Setting-an-alert-recipient
You can set the alert target (a email) using the global "set alert" statement or the "alert" statement in the context of a service entry. But you can not set a email address in a context of a test. You can check the behaviour by using "monit -v" to get some Monit internal information about the configuration.
This looks like this, based on your sample.