[Top][All Lists]

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

[monit] Only monitor processes with present PID files?

From: Joel Krauska
Subject: [monit] Only monitor processes with present PID files?
Date: Tue, 24 Nov 2009 23:08:36 -0800
User-agent: Thunderbird (X11/20090817)

I'm just toying around with monit, and I'm hesitant to give it full control 
just yet.

I want to configure monit to restart a crashed daemon, but not to try to start 
one just because none is running yet.

ie If there's a pid file from normal init.d startup, but no process, something probably crashed, restart.

If there's no pid file, just sit tight.

I was hoping to do this by depend-chaining a file check and a process check, 
but it doesn't appear to be working..

check process apache with pidfile /var/run/
 depends on apache_pidfile
 start program = "/tools/ start"
 stop program  = "/tools/ stop"
if 3 restarts within 5 cycles then timeout group server

check file apache_pidfile with path /var/run/
 #start program = "/bin/false"
 mode passive
 group server


This will identify that 'apache_pidfile' file doesn't exist , but it still trys to restart apache. 'apache' trying to restart
It seems the depend chain logic may not be working?

Or I was also search for a 'missing' type keyword.

check file apache_pidfile with path /var/run/
if missing unmonitor

Or something like that.


This is monit version 4.8.1


Joel Krauska

reply via email to

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