2

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?

6

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

2
  • Error: syntax error 'not'. Any ideas? Dec 13 '11 at 6:51
  • working with last version monit (I've got stable Debian with slightly older one) Dec 17 '11 at 15:09
2

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

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

Stop monit when run backup.

Like:

  ==backup.sh==
  /usr/local/etc/rc.d/monit stop
  ...do backup...
  /usr/local/etc/rc.d/monit start
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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