Вопрос

I'm currently working on a Monit config that alerts when a certain status reached the threshold.

check program check_something with path "/root/scripts/check_something.sh"
  if status > 10 then alert

The above config works well and I would like to add a recurring alert everyday if the status is still more than the threshold.

Это было полезно?

Решение

I've managed to solve the issue by adding timeout of 86400 seconds which is equivalent to 1 day.

check program check_something with path "/root/scripts/check_something.sh"
  if status > 10 then alert
  if status > 10 with timeout 86400 seconds then alert

Другие советы

You should use setting an error reminder.

First, grab the duration of your cycle. It's usually in the /etc/monitrc file with set daemon n where n is the duration.

Then, if you want one every day, calculate the number of cycles per day:

number_cyle_per_day = 24*60*60/n

And finally, use it in your script :

check program check_something with path "/root/scripts/check_something.sh"
  if status > 10 then alert reminder on number_cyle_per_day cycles

it should work like this!

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top