I've got Monit configuration with:

check system example.com
    if loadavg (1min) > 4 then alert
    if loadavg (5min) > 2 then alert

I want to get rid of messages every time backup is running at night, but I do not want to turn it off completely.

How to add check for gzip/bzip2 process runing like:

`ps aux | grep '\[gb\]zip'`

or disable that one check at some time?

link|improve this question
feedback

3 Answers

up vote 5 down vote accepted

You can tell Monit to stop monitoring during certain times (ie while your backup is running). It uses the same syntax as cron. There are good examples in Monit Documentation in the Service Poll Times section. You probably want something like:

check system example.com
not every "* 2-4 * * *"

This will stop monitoring every night from 2am-4am

link|improve this answer
Error: syntax error 'not'. Any ideas? – Jacek_FH Dec 13 '11 at 6:51
working with last version monit (I've got stable Debian with slightly older one) – Jacek_FH Dec 17 '11 at 15:09
feedback

You should "unmonitor" the system load check during the backup interval.

monit unmonitor example.com

You can do this for a specific duration with an at script or just cron, if you know your backup window time.

Resume the monitoring after the backup window:

monit monitor example.com

link|improve this answer
That sounds good but I've got problem with it (root, shell): # monit unmonitor example.com monit: action failed -- You are <b>not</b> authorized to access <i>monit</i>. Either you supplied the wrong credentials (e.g. bad password), or your browser doesn't understand how to sup – Jacek_FH Oct 4 '11 at 11:46
What's the output of monit status ? – ewwhite Oct 4 '11 at 12:02
monit: cannot read status from the monit daemon. Monit listens on 0 0.0.0.0:2812 and is not blocked on firewall or anything – Jacek_FH Oct 4 '11 at 12:17
status, unmonitor etc. are "Optional action arguments for non-daemon mode", but my monit runs as daemon – Jacek_FH Oct 4 '11 at 12:22
feedback

Stop monit when run backup.

Like:

  ==backup.sh==
  /usr/local/etc/rc.d/monit stop
  ...do backup...
  /usr/local/etc/rc.d/monit start
link|improve this answer
that replace one problem with another: serverfault.com/questions/253263/… – Jacek_FH Oct 4 '11 at 12:27
it works with set alert admin@example.com but not on { instance } – Jacek_FH Oct 4 '11 at 12:30
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.