문제

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