0

I have problem with monit. I'm monitoring MySQL service for example... and when I execute system updates like apt-get upgrade or dist-upgrade ... sometimes is upgraded monitored services.

System need stop service for upgrade, and will do it. But monit found that, and restart it... so system upgrading fails on errors, that several file were upgraded but several files would not be upgraded.

Is any way how learn to know monit that system upgrade is running?

user5332
  • 141
  • 4

1 Answers1

0

Your apt-get doesn't know you are running Monit, so it stops the services normally during upgrade, and Monit is set up to detect that as a failure, causing restart.

I see two easy options:

  • Stop Monit service before upgrade and start it when you are done.
  • Configure Monit service monitoring mode to be passive.

    Syntax: MODE <ACTIVE | PASSIVE>

    In active mode, Monit will pro-actively monitor a service and in case of problems raise alerts and restart the service. Active is the default mode.

    The passive mode is similar to the active mode, except if the service fails, monit will not try to fix a problem by restarting the service and will raise alerts only.

It would be tricky but probably plausible to modify apt-get to stop services through monit stop service, making Monit aware that the service should be stopped. If someone has actually done this, I hope we'll get another answer on that!

Esa Jokinen
  • 43,252
  • 2
  • 75
  • 122