質問

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