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

I'm trying to configure Monit to run my script but it's not working.

I'm running Monit 5.3.2 from a Ubuntu 11.2 environment (it's a virtual machine, my machine actually is Windows 7), and for some reason I cannot make the "check program" to work. It always gives the error: Warning: Program is not executable: 'scriptPath'.

Just in case, I tested by copying the example Monit has on the manual (http://mmonit.com/monit/documentation/monit.html) and created the script as the manual, as described below:

An example:

  check program myscript with path "/usr/local/bin/myscript.sh"
  if status != 0 then alert 

Sample script for the above example (/usr/local/bin/myscript.sh):

 #!/bin/bash
 echo test
 exit $?

Anyway, even with those instructions, I still receive the same error message: Warning: Program is not executable: /usr/local/bin/myscript.sh

I have no idea what can be happening. Any suggestion is very welcome.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

As the error message says, your script file is not executable. You need to add the x permissions using chmod:

chmod +x /usr/local/bin/myscript.sh
share|improve this answer
    
Hi Mihael, thank you so much! It worked! As you see, I'm not only new to Monit but also to Linux! –  Thaís Jun 22 '12 at 5:13
add comment

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.