[CentOS] Service monitoring/"Monit"?

Toralf Lund

toralf.lund at pgs.com
Fri Jun 11 07:21:37 UTC 2010


Has anybody here tried the "Monit" utility (http://mmonit.com/monit/)? I 
need to set up some kind of "watchdog" functionality for a custom 
service otherwise started via init (i.e. via a script in /etc/init.d + 
rc*.d links managed by chkconfig) and it seems like this system may give 
me nearly what I want. However, something that concerns me about it, is 
that it appears to take full ownership of the services it monitors, and 
pretty much bypass the init system, in that once I've told monit to 
watch a process, it makes not difference if the associated service is 
enabled or not (via "chkconfig") , and there is no good way to fully 
stop the service, besides removing the Monit config or disabling Monit 
itself. (Or maybe I can use special "monit" commands, too, but that 
means precisely that Monit "owns" the service, which I somehow don't 
quite like.)

What I'd really like, is to have my process watched and restarted if it 
goes a way, but only if it had already been started via "init" or 
through the "service" command, or possibly direct execution of the 
"init.d" script. This also means it should be restarted if it crashes or 
if is stopped via a direct "kill", but not after "service <name> stop" 
or similar. Which might mean it all boils down to checking if, and only 
if, the pid file for the service already exists.  (Does that make any 
sense?)

So, does anyone know if there is a way to convince Monit to do this for 
me? Or alternatively, is there a different tool that might do the job?

And yes, I know it shouldn't be that hard to design a 
program/script/cron job to do it all for me, but I still think not 
having to maintain another software component would be nice...

- Toralf

This e-mail, including any attachments and response string, may contain proprietary information which is confidential and may be legally privileged. It is for the intended recipient only. If you are not the intended recipient or transmission error has misdirected this e-mail, please notify the author by return e-mail and delete this message and any attachment immediately. If you are not the intended recipient you must not use, disclose, distribute, forward, copy, print or rely on this e-mail in any way except as permitted by the author.



More information about the CentOS mailing list