15

When you monitor a process with Monit by its pid, like :

check process blop with pidfile /.../blop.pid
      start program = "..."
      stop  program = "..."

you get an alert when the pidfile is changed.

How do you disable this alert? For example, if you only want to know when the process fails to be restarted.

aurels
  • 273
  • 2
  • 6

2 Answers2

21

You can disable this alert by setting up a local alert statement. This is thoroughly documented here: http://mmonit.com/monit/documentation/monit.html#setting_a_local_alert_statement

This should do it:

check process blop with pidfile /.../blop.pid
    alert recipient@address.com but not on { pid }
    start program = "..."
    stop  program = "..."
Kvisle
  • 4,113
  • 23
  • 25
2

Another option is disabling alerts on

set alert user@mydomain.org not on { instance, action }

This way you will not receive alerts for monit restart (instance) nor alerts for all services start/stop/restart (action).

Full list of possible filters for this can be found at: https://mmonit.com/monit/documentation/monit.html#Setting-an-event-filter (I think this list should also apply to the alerts attached to process checks of another answer for this question).

timurb
  • 347
  • 3
  • 12