Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 dan@example.com

monit reload says:

/etc/monit/conf.d/example:13: Error: syntax error 'dan@example.com'

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.

share|improve this question

Uncomment/Add these lines in your monit config file:

set mailserver localhost
set alert me@mycompany.com

Then do something like the following. Notice that there is nothing after "alert".

check program list-files with path "/bin/ls -lrt /tmp/"
     if status != 0 then alert
share|improve this answer

Check the documentation at http://mmonit.com/monit/documentation/monit.html#setting_a_local_alert_statement it has the following example

check process mybar with pidfile /var/run/mybar.pid
  alert foo@bar only on { timeout }
share|improve this answer
    
I saw that example, but how does it relate to this? That example says "each service can have its own recipient list." How is this statement a service? And it also shows that a legal alert in that context has only an email address, no "only on { timeout }". – dfrankow Apr 4 '13 at 14:02

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.