monit-general
[Top][All Lists]
Advanced

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

Re: Monitor multiple instances of a process


From: Þórhallur Hálfdánarson
Subject: Re: Monitor multiple instances of a process
Date: Wed, 10 Nov 2010 08:33:06 +0000

I myself have just recently started playing with monit, for a very similar scenario.  My suggestion would that you replace "process foo" with "process foo0" and foo1.  This parameter doesn't have to have the same name as the program you are checking, but rather a unique identifier of the monitoring instance.

However, I believe you also need to pass foo0.pid or foo1.pid as an argument to cccstop.sh and cccstate.sh, in order for the scripts to stop the correct instance and write to the correct pidfile, respectively.

Best regards,
Tolli


2010/11/10 ChetanK <address@hidden>

I have 4 instances of a process say "foo" each of which has created a pid
file "/var/run/foo1.pid, /var/run/foo2.pid...."

I configured monit as follows:

check process foo with pidfile /var/run/foo0.pid
  stop program = "/home/dpadmin/cccstop.sh"
  start program = "/home/dpadmin/cccstate.sh"
  if 1 restarts within 1 cycles then timeout

check process foo with pidfile /var/run/foo1.pid
  stop program = "/home/dpadmin/cccstop.sh"
  start program = "/home/dpadmin/cccstate.sh"
  if 1 restarts within 1 cycles then timeout

....

Now when I check whether the file is valid (sudo monit -t), I get the
following error:
/etc/monit/monitrc:191: Error: service name conflict, foo already defined
'/var/run/foo1.pid'

How can I configure monit to monitor multiple instances of the process
"foo"?

thanks,
chetan
--
View this message in context: http://old.nabble.com/Monitor-multiple-instances-of-a-process-tp30178165p30178165.html
Sent from the monit-general mailing list archive at Nabble.com.


--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general


reply via email to

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