Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

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

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

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

share|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 Kaniuk 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 Kaniuk Oct 4 '11 at 12:17
    
status, unmonitor etc. are "Optional action arguments for non-daemon mode", but my monit runs as daemon –  Jacek Kaniuk Oct 4 '11 at 12:22
add comment

Stop monit when run backup.

Like:

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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