3

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

Dave M
  • 4,494
  • 21
  • 30
  • 30
user5332
  • 141
  • 4

2 Answers2

0
 monit unmonitor all   - Disable monitoring of all services
 monit unmonitor name  - Only disable monitoring of the named service
T'Saavik
  • 13
  • 3
  • 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 07 '19 at 00:53
0

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...

boppy
  • 476
  • 2
  • 5