-   Linux - Software (
-   -   Problem with Setting up monit (

helptonewbie 07-04-2007 03:18 PM

Problem with Setting up monit

I've got a problem, within monit my first time of using it ever so still noob in it but in any case, am expanding my horizons. What i have a problem is, this part :


check process apache with pidfile /var/run/
  start program = "/etc/init.d/httpd start"
  stop program  = "/etc/init.d/httpd stop"
  if cpu > 60% for 2 cycles then alert
  if cpu > 80% for 5 cycles then restart
  if totalmem > 200.0 MB for 5 cycles then restart
  if children > 250 then restart
  if loadavg(5min) greater than 10 for 8 cycles then stop
  if failed host port 80 protocol http
      and request "/webwarning.htm"
      then exec "/root/testing.bash"
#    if failed port 443 type tcpssl protocol http
#      with timeout 15 seconds
#      then restart
  if 3 restarts within 5 cycles then timeout
#    depends on apache_bin
  group server

its the (then exec "/root/testing.bash") i thought this should execute my script file, but it just doesn't work, even though the file is set as executable and works fine if i just run it as normal from the konsole.

This test all works fine and before hand it was just a (then alert) and i changed it because i wanted it to run my script instead which doesn't seem to happen.

Does anyone have an idea as to what the problem could be

rtspitz 07-28-2007 09:07 PM

does monit run as root ?

your script is in /root/.... maybe monit cannot get in there if it runs as some other user.

helptonewbie 07-29-2007 04:24 PM

no problems thanks for the reply all fixed now, ca't tell you the problem tried it on a different server and worked fine so...

Anyway cheers

All times are GMT -5. The time now is 06:50 PM.