monit-general
[Top][All Lists]
Advanced

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

Quietly restart process, alert only if restart fails?


From: Simon Coffey
Subject: Quietly restart process, alert only if restart fails?
Date: Thu, 27 Oct 2011 17:58:14 +0100

Hi all,

I have a worker process that frequently balloons in memory usage
ordies, requiring a restart. This happens often enough (and
therestarting is reliable enough) that the alert mails are a
constantsource of noise, leading to their being tuned out by the team.
I would like to achieve the following:
1) If process exceeds 300MB memory for 5 cycles, attempt silent
restart2) If the restart fails (so, say, if process doesn't exist for
3+cycles), *then* send a nonexist alert
Is this possible? I've tried the following:
check worker_process  with pidfile /var/run/worker_process.pid  start
program = "/my/start/script"  stop program = "/my/stop/script"  if
totalmem is greater than 300MB for 5 cycles then restart  if does not
exist then restart  if does not exist for three cycles then alert
But it seems you can only have one clause for each type of condition
-one of the "if does not exist" clauses will be ignored.
Another alternative might be to have two checks on the same process
-one to restart, and one to alert - but this seems like a
horribleduplication of configuration; surely there's a more elegant
solution.
If anyone's got any ideas, I'd be very grateful, as would my team
andtheir inboxes... :-)
Simon
-- 
Simon Coffey
Developer, Tribesports
address@hidden | 07960 004 857



reply via email to

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