[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: monit unresponsive to status requests?

From: Marco Ermini
Subject: Re: monit unresponsive to status requests?
Date: Mon, 18 Jul 2005 11:26:22 +0200

On 7/16/05, Jan-Henrik Haukeland <address@hidden> wrote:
> 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).

AFAIK, it's mainly a startup script issue. For instance, I can see
that different Linux distro acts differently on this on the same
programs... for instance, RedHat startup scripts sometimes mess up
Courier IMAP writes more than a PID number in the PID file... :-P I
think Monit could be configured to handle such situations - if this is
an issue.

About it, I could just tell you what, usually, OpenView sysadmin
did... They usually just check that a particular string, as it appears
unsing the "ps" command with verbose option (the actual options
depends on the Unix version, of course), appears in the process list,
and how many times it appears.

For instance, they instruct OpenView to watch for processes which name
starts with  "/opt/bin/java -server", and they want to see at least
four of them.

Or - another useful feature... - they just want to have OpenView
execute a script on the host using, for instance, Korn shell, and
having it returning a value. This would be also very nice to see in

I see that Monit is much more "intrusive" since it really checks
processes and not the result of a "ps" command. OpenView is more
flexible. Or at least, it is usually used in this way.

> 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/"
>      start program = "/etc/init.d/foo start"
>      stop program = "/etc/init.d/foo stop"
>      if children < 8 then alert # or restart

Sure, this would be really useful, and it would be a much more
effective check that the OpenView one.

So we would only miss few option... executing an external script,
checking (grep for strings/patterns/regex) a log file... and NOT
BECOMING UNRESPONSIVE to queries when it is starting/stopping
processes :-)

> I 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?

You are right - as usual ;-)

Marco Ermini
Dubium sapientiae initium. (Descartes)
address@hidden # mount -t life -o ro /dev/dna /genetic/research
<< This message is for the designated recipient only and may contain
privileged or confidential information. If you have received it in
error, please notify the sender immediately and delete the original.
Any other use of the email by you is prohibited. >>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]