I'm trying to set up monit on a virtual machine running
CentOS release 5.5 (Final). Monit version is 5.2. For some reason monit
cannot connect to the http server. I tried to use localhost, hostname,
hostname.tld, and the IP address. Anyway still no luck. From command line a wget "
" works like a charm. Same thing while testing this with hostname,
hostname.tld, and the IP address. I even tried to downgrade to version 5.1...
-------------------
monit [0x805433e]
monit(LogError+0x22) [0x8054752]
monit(check_http+0x4d8) [0x80718c8]
monit [0x8064cca]
monit(check_process+0x69) [0x80656c9]
monit(validate+0x1bf) [0x8065bbf]
monit [0x8056805]
monit(main+0x537) [0x80570d7]
/lib/libc.so.6(__libc_start_main+0xdc) [0x4cd36e9c]
monit [0x804eda1]
-------------------------------------------------------------------------------
'httpd' failed protocol test [HTTP] at INET[hostname.domain.tld:80] via TCP
-------------------------------------------------------------------------------
monit [0x805433e]
monit(LogError+0x22) [0x8054752]
monit(Event_post+0x382) [0x8051de2]
monit [0x8064edf]
monit(check_process+0x69) [0x80656c9]
monit(validate+0x1bf) [0x8065bbf]
monit [0x8056805]
monit(main+0x537) [0x80570d7]
/lib/libc.so.6(__libc_start_main+0xdc) [0x4cd36e9c]
monit [0x804eda1]
-------------------------------------------------------------------------------
Connection failed notification is sent to
address@hidden
'httpd' trying to restart
Monitoring disabled -- service httpd
'httpd' stop: /etc/init.d/httpd
Stopping httpd: [ OK ]
monit: pidfile '/var/run/httpd.pid' does not exist
monit: pidfile '/var/run/httpd.pid' does not exist
monit: pidfile '/var/run/httpd.pid' does not exist
'httpd' start: /etc/init.d/httpd
monit: pidfile '/var/run/httpd.pid' does not exist
monit: pidfile '/var/run/httpd.pid' does not exist
Starting httpd: [ OK ]
Monitoring enabled -- service httpd
Here are the configuration parameters regarding httpd service :
check process httpd with pidfile /var/run/httpd.pid
group apache
start program = "/etc/init.d/httpd start"
stop program = "/etc/init.d/httpd stop"
if failed host hostname.domain.tld port 80 protocol http
and request "/monit/token" then restart
if cpu is greater than 60% for 2 cycles then alert
if cpu > 80% for 5 cycles then restart
if totalmem > 500 MB for 5 cycles then restart
if children > 250 then restart
if loadavg(5min) greater than 10 for 8 cycles then stop
if 3 restarts within 5 cycles then timeout
Any help appreciated.
Alex.