|
From: | Harish Chouhan |
Subject: | RE: Restart issue with HTTPD & SSHD |
Date: | Wed, 7 Dec 2011 19:59:05 +0530 |
Hello Martin, I have changed my code with what you sent: start program = "/bin/bash -c '/etc/init.d/httpd start >>/tmp/httpd.output 2>&1'" Now the Start & Stop work well. However restart does not work. I don’t think I would need the restart option, but I just want to things to be right. So would appreciate your help. When I click on the restart button, the status changes to “Execution Failed”. Same issue when I click restart button on the SSH process. Also can you let me know how to access the log file /tmp/httpd.output? I found no such file on my server. Awaiting your reply! Regards, Harish Chouhan Visit me at - www.harishchouhan.com From: Martin Pala [mailto:address@hidden Hi, it is possible the start/stop program failed because of some missing environment variable - monit purges the environment when executing the program for security reasons and sets only basic PATH variable. Monit doesn't log the output from the start/stop script by default, you can capture the output by wrapping the program like this: start program = "/bin/bash -c '/etc/init.d/httpd start >>/tmp/httpd.output 2>&1'" Regards, Martin On Dec 3, 2011, at 1:42 PM, Harish Chouhan wrote: Hello, I have installed monit and everything is running great, except httpd and sshd. My monitoring code is as below. The monitoring starts well when I start Monit for the first time. However if I restart or stop this from the web based control of Monit, I get “Execution failed” message. ## HTTPD monit config check process apache with pidfile /usr/local/apache/logs/httpd.pid group apache start program = "/etc/init.d/httpd start" stop program = "/etc/init.d/httpd -k stop" if failed host localhost port 80 protocol http then alert if failed host localhost port 80 protocol http then restart if cpu > 60% for 2 cycles then alert if cpu > 80% for 5 cycles then restart if children > 250 then restart ## SSHD monit config check process sshd with pidfile /var/run/sshd.pid start program "/etc/init.d/sshd start" stop program "/etc/init.d/sshd stop" if failed port 2511 protocol ssh then restart if 5 restarts within 5 cycles then timeout My log files also do not give clear details about this error. [IST Dec 3 18:11:05] info : 'apache' trying to restart [IST Dec 3 18:11:05] info : 'apache' stop: /etc/init.d/httpd Can anyone else? Regards, Harish |
[Prev in Thread] | Current Thread | [Next in Thread] |