Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

2 Answers 2

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/hwtest.sh"
  if status = 1 then alert
share|improve this answer

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.