Open techmjohnson opened 6 years ago
These behaviors can also be configured using Sensu filters, or by configuring flapping thresholds for the individual Sensu checks. These "occurrences" or "refresh" behaviors should not be specific to the OpsGenie handler, but something that is done in Sensu, for any handler.
@techmjohnson As @Castaglia says, occurrences
and refresh
behaviour in the more recent versions of Sensu is something that the built in occurrences filter (https://github.com/sensu-extensions/sensu-extensions-occurrences) observes by default. To get the behaviour you want you should just need to have the occurrences
filter set on your handler.
If you also want the handler to be killed after a certain period you can set timeout
on your handler definition.
concur, we can close this one up.
Even though setting the filter in my handler, this is not honnored in my case.
The current iteration of the handler doesn't handle the occurrences or refresh filters. Even if we pass this down through sensu to the handler, it's currently ignored.
Example check can be defined like this, but all "additional" values must be used by the handler or they're ignored:
sensu_check 'nameofcheck' do command 'runsomescript.sh' handlers opsgenie interval 120 timeout 60 additional(:occurrences => 2, :refresh => 10, :ttl => 30) standalone true end
expected filter in the handler would be able to validate that this check has met the following requirements before notifying: failed 2 times in a row (occurrences) would run again after 10 seconds (refresh) and would kill itself after 30 seconds (ttl)