I have this in a monit script (lines 11-13):
check program foo with
path "/usr/local/bin/foo.sh" with timeout 300 seconds
if status != 0 then alert [email protected]
monit reload says:
/etc/monit/conf.d/example:13: Error: syntax error '[email protected]'
None of the examples show an email with the alert, but I need one. Why can I not give one here?
I'm using Monit 5.5.
Uncomment/Add these lines in your monit config file:
Then do something like the following. Notice that there is nothing after "alert".
Check the documentation at http://mmonit.com/monit/documentation/monit.html#setting_a_local_alert_statement it has the following example
Look specifically at: https://mmonit.com/monit/documentation/monit.html#Setting-an-alert-recipient (new link), the way I read this, for a local alert (if you want an additional email for just this alert), you would add it to the end of the current section.
From the link above:
Local alert example:
You will note, the failed check and alert notification are on the second and third lines, then a local email address is added to the final line.