I have a problem with monitoring services by Monit.

Monitoring works well. Too well.

When I execute system update... possibly update of MySQL or Apache etc. needs to be service down. Updating process does that, and then Monit service restart... and updates installation fail or is corrupted because of Monit did service up.

Is possible to pause monitoring of monit when is system updating. I don't do updates by hand... but by unattended-updates

 monit unmonitor all   - Disable monitoring of all services
 monit unmonitor name  - Only disable monitoring of the named service
| improve this answer | |
  • Solution that is not solution... It do exatly that... but unmonitor all sent tons of e-mails that services were unmonitored and after taking it back it send next tons of e-mails that services are monitored... And the last point unattended upgrades has no funtion to run this commands pre and post updates :( NO SOLUTION – user5332 Feb 23 '19 at 18:19
  • To stop the email spam: set alert user5332@mycompany.com but not on { action }.Can't help with unattended upgrades, personally I don't do those on servers. – T'Saavik Mar 7 '19 at 0:53

I see two possible solutions. Both limit the actual monitoring, but will reduce the fault positive mails...

I would recommend to add Fault Tolerance here:

check process apache pidfile /run/apache.pid
  if failed
    port 80 for 3 cycles
  then alert

You might also want to check Service Poll Time:

check process apache pidfile /run/apache.pid
  not every "0-10 1 * * *"
  if failed then alert

This will make Monit not check apache between 1:00 AM and 1:10 AM. So if your schedule matches, you should not receive alerts in this timeslot...

| improve this answer | |

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.