0

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.

Zoredache
  • 128,755
  • 40
  • 271
  • 413
ThaisK
  • 121
  • 6

1 Answers1

1

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
mgorven
  • 30,036
  • 7
  • 76
  • 121
  • Hi Mihael, thank you so much! It worked! As you see, I'm not only new to Monit but also to Linux! – ThaisK Jun 22 '12 at 05:13