7

I have rule like this:

if memory usage > 85% for 10 cycles then alert

I want to notify not only via email but also via slack. So I can add second line like this:

if memory usage > 85% for 10 cycles then exec /path/to/slack.rb

It's annoying when you have multiple rules and you have to duplicate each line. Is it possible to use alert and exec together? Something like this:

if memory usage > 85% for 10 cycles then alert and exec /path/to/slack.rb
Alexander
  • 173
  • 6

1 Answers1

3

In this case, there is no need to have two rules. The second one (with exec) is enough. If you have set alert configured monit will alert you when a limit is matched. But if you don't want to receive an alert, use an additional rule noalert your@email.

averale
  • 46
  • 2
  • What about a similar case, with many check "if ... alert ..." : is it possible to keep the alerts and write only one final "if alert then exec ..." ? – Massimo Aug 13 '18 at 16:12