monit-general
[Top][All Lists]
Advanced

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

Re: is there a better way?


From: Nick Upson
Subject: Re: is there a better way?
Date: Fri, 8 Feb 2013 10:45:51 +0000


check device opt with path /opt
    if space usage > 99% then stop else start

doesn't work, once the syntax is correct, the start never happens because the stop has unmonitored the check

check device opt with path /opt
  if space usage > 90% then stop
  else if succeeded then start



On 25 January 2013 11:04, Michael Johnson - MJ <address@hidden> wrote:
Yeah, there is a better that I believe will do what you want.

Change that to:

check device opt with path /opt
    if space usage > 99% then unmonitor

And then add this to your mysql check:

    depends on opt


That should do it.  Because mysql now depends on opt, if opt becomes unmonitored, mysql should be stopped.  You will have to manually tell monit to start watching the filesystem again when you have clean up things.

You might even be about to do this:

check device opt with path /opt
    if space usage > 99% then stop else start

If I am correct, this will cause the depenent service to stop when file system is over 99% full and start it when the usage drops.


On Thu, Jan 24, 2013 at 2:10 AM, Nick Upson <address@hidden> wrote:
currently I have

check device opt with path /opt
if space usage > 99% then
  exec "/bin/bash -c '/usr/bin/monit stop database'"


--
Nick Upson, Telensa Ltd

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



--
Michael Johnson - MJ

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



--
Nick Upson, Telensa Ltd

reply via email to

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