|
From: | Jan-Henrik Haukeland |
Subject: | Re: monit unresponsive to status requests? |
Date: | Sat, 16 Jul 2005 17:17:17 +0200 |
On 15. jul. 2005, at 23.53, Randy Bias wrote:
On Jul 15, 2005, at 6:27 AM, Jan-Henrik Haukeland wrote:On 15. jul. 2005, at 09.51, Marco Ermini wrote:Actually, this reminds me of another question, that should arguably be in a separate e-mail: Have you considered having monit handle multiple PIDs in a file or multiple PID files for a single "service" that hasThis is what OpenView already did... an this is another reason becausemultiple processes. For example, nfsd typically starts up withmultiple processes. It would be nice to tell monit: make sure there are always 8 of these running and gave it 8 PIDs to check. This seemslike a very useful feature.I can't scale Monit in a bigger environment, it is confined to minor projects by now.I'm not sure how we should go about solving this problem. If you have any ideas, please share.[...]
It's the program responsibility to create the pid-file and write the correct pid to this file, monit will not do this! I'm on thin ice here but AFAIK few programs, if any, write all it's pids to the same pid file? Even so, it would be kind of wrong since it is the parent process that is important (and the one monit needs to watch).
I don't see why it's not sufficient for monit to monitor the parent process only. Take for instance apache - it fires off a lot of child processes (fork-model) but apache only write the parent process to the apache pid file, since this is the important controlling process.
Monit already has a feature for monitoring the number of child processes. I think it should be enough to say something like this:
check process foo with pidfile "/var/run/foo.pid" start program = "/etc/init.d/foo start" stop program = "/etc/init.d/foo stop" if children < 8 then alert # or restartI mean, if monit monitored a pid file with several pids, what could monit do more than in the above example if one of those processes stopped?
-- Jan-Henrik Haukeland Mobil +47 97141255
[Prev in Thread] | Current Thread | [Next in Thread] |