|
From: | Harish Chouhan |
Subject: | Restart issue with HTTPD & SSHD |
Date: | Sat, 3 Dec 2011 18:12:23 +0530 |
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 From: Martin Pala [mailto:address@hidden Please read the monit manual. 1.) the "address" option is optional and makes monit listen to specific interface => if you'll remove it, monit will listen on all interfaces on the machine 2.) the "allow" option sets access restrictions - you can combine multiple "allow" options to require username/password and/or allow only access from specific IP addresses. On Oct 30, 2011, at 11:06 PM, Harish Chouhan wrote: Hello Martin, So do you mean if I add “allow my.ip.address” I could then access Monit with a link such as “http://server-ip:2812? Awaiting your reply! Regards, Harish Chouhan Visit me at - www.harishchouhan.com From: Martin Pala [mailto:address@hidden The "allow" options which are also included in your configuration protect the access with usrname+password. You can also limit the access to specific IP addresses (in addition to username/password) for example like this: "allow 1.2.3.4" On Oct 30, 2011, at 10:43 PM, Harish Chouhan wrote: Hello Martin, Thank you for that. It works now. Just one question, is this safe? Or there any other way for me to access this without allowing other users to even see the login page? Regards, Harish Chouhan Visit me at - www.harishchouhan.com From: Martin Pala [mailto:address@hidden The "use address localhost" option makes monit listen only on 127.0.0.1 (loopback) => it will be accessible via http://127.0.0.1:2812 on the same host where monit is running, but not from other hosts. If you want to access it from other hosts, remove this option. Regards, Martin On Oct 30, 2011, at 5:09 PM, Harish Chouhan wrote:
|
[Prev in Thread] | Current Thread | [Next in Thread] |