Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

Is there a way to check the result of a script with monit? For example a script returns 0 means ok, but 1 means failed. The idea is to call the script from monit on the local machine directly and interpret the result and send emails.

For example a script could do some hardware check.

My workaround is to call the script with cron and write the result to a file and check the file with monit.

share|improve this question
up vote 1 down vote accepted

Your work-around is the recommended way to do it with monit from what I've read.

share|improve this answer

You should use Program status testing

For example:

check program hwtest with path "/path/to/your/"
  if status = 1 then alert
share|improve this answer

Your Answer


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.