monit-general
[Top][All Lists]
Advanced

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

Re: [monit] Can monit monitor multiple processes with the same name?


From: Martin Pala
Subject: Re: [monit] Can monit monitor multiple processes with the same name?
Date: Tue, 9 Mar 2010 22:49:13 +0100

Yes, if you will have one parent process which is common to all "abcdef" 
processes. The "totalcpu" statement then allows to sum CPU usage of all 
process' children - you won't watch the "abcdef" processes PID but the parent 
process' PID (this is similar to Apache  process based worker model)

Regards,
Martin

On Mar 9, 2010, at 1:56 PM, Bill Benedetto wrote:

> Good day.
> 
> I use monit (mostly) to watch my desktop systems and watch for
> long-running, cpu-eating programs.
> 
> My stanza of interest looks like this:
> 
>  check process abcdef with pidfile /var/run/abcdef.pid
>    alert address@hidden but not on { Nonexist }
>    stop program = "/bin/bash -c 'kill `cat /var/run/abcdef.pid`'"
>    if cpu usage > 22% for 64 cycles then stop
> 
> My abcdef process doesn't create a pidfile, so I have a cronjob
> that runs a few times per hour and looks for the abcdef process,
> creating a pidfile, and then tickling monit to take a look.
> 
> This works great for me.  However (you knew there had to be a
> "however"), I sometimes have multiple abcdef processes on the
> same machine.  monit DOES clean them up eventually, but just one
> at a time since I can only watch one abcdef.pid.  (There's a
> secondary problem that if I have, for example, 2 abcdef processes
> running concurrently, they might each take 12% of the cpu and
> thus monit never kills either one.)
> 
> Is there a way I can set monit up so that it is able to monitor
> multiple abcdef processes concurrently?
> 
> Thanks!
> 
> -- 
> - Bill
> +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
> Bill Benedetto     <address@hidden>    The Goodyear Tire & Rubber Co.
> I don't speak for Goodyear and they don't speak for me.  We're both happy.
> 
> 
> 
> --
> To unsubscribe:
> http://lists.nongnu.org/mailman/listinfo/monit-general





reply via email to

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