Monit was not able to detect that the process is running - maybe the user under which Monit is running has no access to the "/var/run/memcached.pid" file? (you can check it with "ls -l ...") Did the process really started? Monti sets spartan environment for the start program execution - maybe your start script depends on some environment variable or some extended PATH or LD_LIBRARY_PATH?
Alternatively you can use pidfile-less monitoring:
check process memcached matching "memcached" ...
Regards, Martin
On Jun 4, 2011, at 11:57 AM, Sergey Levchenko wrote: Hi List! I have some problems with monit 5.2.5. More then two days I'm trying to enable memcahced server monitoring, but monit unable to detect memcahed neither by pid neither by port 11211.
Log entries:
[EDT Jun 3 10:51:39] info : Starting monit daemon with http interface at [$ [EDT Jun 3 10:51:39] info : Starting monit HTTP server at [*:2812] [EDT Jun 3 10:51:39] info : monit HTTP server started
[EDT Jun 3 10:51:39] info : 'system_ip-10-128-98-10.ap-southeast-1.compute$ [EDT Jun 3 10:51:40] error : 'memcached' process is not running [EDT Jun 3 10:51:40] info : 'memcached' trying to restart
[EDT Jun 3 10:51:40] info : 'memcached' start: /etc/init.d/memcached [EDT Jun 3 10:52:06] error : 'memcached' failed to start [EDT Jun 3 10:52:06] error : monit: Cannot open the monit state file '/var/$
[EDT Jun 3 10:52:10] error : monit: Error opening the idfile '/var/monit/id$ [EDT Jun 3 10:52:10] info : Starting monit daemon with http interface at [$ [EDT Jun 3 10:52:10] info : Starting monit HTTP server at [*:2812]
[EDT Jun 3 10:52:10] info : monit HTTP server started [EDT Jun 3 10:52:10] info : 'system_ip-10-128-98-10.ap-southeast-1.compute$ [EDT Jun 3 10:52:10] error : 'memcached' process is not running
[EDT Jun 3 10:52:10] info : 'memcached' trying to restart [EDT Jun 3 10:52:10] info : 'memcached' start: /etc/init.d/memcached [EDT Jun 3 10:52:40] error : 'memcached' failed to start
monitrc:
set daemon 60 set logfile /var/log/monit.log set mailserver localhost set mail-format { from: address@hidden } set alert address@hidden
set httpd port 2812 and allow root:elmentore check process lighttpd with pidfile /var/run/lighttpd.pid start program = "/etc/init.d/lighttpd start" stop program = "/etc/init.d/lighttpd stop"
if failed host 127.0.0.1 port 80 protocol http then restart if cpu is greater than 60% for 2 cycles then alert if cpu > 80% for 5 cycles then alert if totalmem > 500 MB for 5 cycles then alert if children > 250 then alert
if loadavg(5min) greater than 10 for 8 cycles then alert if 3 restarts within 5 cycles then timeout
check process memcached with pidfile /var/run/memcached.pid #start program = "/usr/bin/memcached -d -P /var/run/memcached.pid -u root -m 512 -l 127.0.0.1 -p 11211"
#stop program = "/bin/kill -9 `cat /var/run/memcached.pid`; rm /var/run/memcached.pid" start program = "/etc/init.d/memcached start" stop program = "/etc/init.d/memcached stop" if failed host 127.0.0.1 port 11211 protocol MEMCACHE then restart
if cpu is greater than 60% for 2 cycles then alert if cpu > 80% for 5 cycles then alert if totalmem > 500 MB for 5 cycles then alert if children > 250 then alert if loadavg(5min) greater than 10 for 8 cycles then alert
if 3 restarts within 5 cycles then timeout
-- To unsubscribe: https://lists.nongnu.org/mailman/listinfo/monit-general
|