monit-general
[Top][All Lists]
Advanced

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

Re: [monit] Condition Process Checking?


From: Martin Pala
Subject: Re: [monit] Condition Process Checking?
Date: Tue, 11 May 2010 21:39:34 +0200

Hi,

yes, you can define checks like this:

--8<--
set alert address@hidden

check process1 with pidfile /var/run/process1.pid
  start program = "..."
  stop program = "..."

check process2 with pidfile /var/run/process2.pid

check process3 with pidfile /var/run/process3.pid
--8<--


The process2 and process3 checks don't need any extra options - when the 
process won't exist, it will generate alert automatically and since there is no 
start/stop program, it won't try to restart the process.

If process2 and process3 have no pidfile, you will need to create it with 
current version of Monit. The next monit version (5.2) allows process check 
based on pattern matching - no need for pidfile, so it is possible to check 
processes like this:

--8<--
check process vmware-debian matching "/usr/lib/vmware/bin/vmware-vmx 
.*debian4-x86.vmx"
--8<--

... the vmware infrastructure is similar to your case - the virtual machines 
are started by one process, but particular machines have no pidfile.

The monit 5.2 ill be release most probably till the end of May, if you want to 
get development version, you can get source code from subversion:

svn checkout http://monit.googlecode.com/svn/trunk/ monit

Regards,
Martin


On May 11, 2010, at 4:55 AM, Robin Abecasis wrote:

> Hi,
> 
> I've searched the FAQ and the list for an answer to this, but didn't find 
> anything.
> 
> I need to check 3 processes. Parent Process1, that will either start 
> process2, or kill process2 and start process . I would like Monit to 
> monitor/handle Process1 (done), but i am stuck on the conditional part of how 
> to monitor Process2 or Process3. I don't need Monitor to automagically 
> start/stop Process2 or Process3, but i need to know if neither (ie only 
> Process1) are running.
> 
> Is this possible?
> 
> Cheers,
> Robin
> 
> 
> 
> 
> --
> To unsubscribe:
> http://lists.nongnu.org/mailman/listinfo/monit-general




reply via email to

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