แสดงบทความที่มีป้ายกำกับ monitoring แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ monitoring แสดงบทความทั้งหมด

วันอังคารที่ 9 มีนาคม พ.ศ. 2553

Monit : debuging monit process

Misconfiguration on apache can lead monit false alet and do wrong action. I found that some monit process in one of my servers always complaining about apache cannot connect port 80. which is not right cause I can still access the pages.

Here are tip for debugging what goes wrong:

1) stop monit as a daemon
2) smart monit in foreground
#monit -Iv
3) see the message

From my experience, the server response with 403 http code cause monit alert cannot connect host port 80.
So, I change apache config to get 200 code and everything back to work :)

Monit : server monitoring tools

If you have a web server, have you ever experience apache process not responding to http request?

or

How to make sure that apache are running? and If server load go too high please restart it for me.

Monit can help you monitoring common for system admin.


It can monitoring server process, file size, memory server load. And, you can set the appropriate action to those events: sending email, restart process etc.

To install monit
for gentoo :
#emerge -av monit
for debian:
#apt-get install monit

Configuring monit
Locate configuration file : /etc/monitrc or /etc/monit/monitrc
Here is the example configuration for apache with these condition
1) check whether apache is running : if not restart
2) check http:80 is working : if not restart
3) if server go to high : restart apache process
set daemon 120

set mailserver smtp.localhost


set mail-format { from: admin@localhost.com }

set alert systemadmin@localhost.com


check process apache with pidfile /var/run/apache2.pid
start program = "/etc/init.d/apache2 start"
stop program = "/etc/init.d/apache2 stop"
if failed port 80 protocol http then restart
if loadavg(5min) greater than 100 for 2 cycles then restart
alert extrapeople@localhost.com

If you are interested in monit for advance feature please visit monit official site.
check out monit document