Edge-triggered checks in Sensu


Hi all,

I’m wondering if it’s possible to do edge-triggered checks in Sensu.

All the checks out there seems to be level-triggered meaning that they look at the current value and alert whenever the value breaches a limit regardless of the previous value. Edge-triggered checks are sometimes useful. A motivating example is Ultra DMA CRC Error Count in SMART. This counter will never be reset even if the problem goes away by e.g. replacing a
failing cable. So a level-triggered check (e.g. check-smart-status.rb) will stop working once we get a increase in the counter.

One possible way is to record the counter on Graphite and use check-graphite-data.rb with taking nonNegativeDrivative of the series. It feels like an involved solution though.

Are there any other simpler ways to do edge-triggered checks?



Hi Mitsutoshi,

Thanks for letting me know. I think is the first time I use a mailing list
where hitting reply emails the person directly instead of the mailing list
(never used google groups before I think).

Yeah if you can comment in the PR that may help to get it integrated.



On Fri, Aug 19, 2016 at 12:08 AM, Mitsutoshi Aoe <maoe@foldr.in> wrote:

Hi Moises,

I'm afraid you forgot to CC the list. Anyway, thank you for your input.

I forgot the fact that check-log.rb stores the state in files. Yes, I
should be able to do the same thing for SMART.

Adding some store in sensu-client sounds great. I think I'll comment on
your PR that your work can be used in stateful checks.