Dear All,
I’ve been struggling with that one…
I work in a limited environment (it’s a cool company but there are some things I cannot do) where:
-
the only version (at this time) of sensu that I can use is 0.16.0 (and it’s not the rpm available on Sensu’s website, unfortunately).
-
I cannot do ‘gem install’ of any kind (breaks supportability) but I can add rpm packages or simple self-contained scripts.
The latter prevents me from using most of the sensu-plugins developed by the community because they include a gem dependency of some kind at some step or another…
I’m limited to the following gems:
gem list|grep sensu
sensu (0.16.0)
sensu-em (2.4.0)
sensu-extension (1.0.0)
sensu-extensions (1.0.0)
sensu-logger (1.0.0)
sensu-settings (1.2.0)
sensu-spawn (1.1.0)
sensu-transport (2.4.0)
So I’m trying to have Sensu send alerts by e-mail and make it -NOT- send e-mail -EVERY- minute for every alert…
My checks include something like this:
“ntpd_health”: {
“handlers”: [“email”],
“command”: “{{ sensu_plugins_path }}/check_ntpmon --okpeers 1”,
“subscribers”: [
“overcld_generic”
],
“interval”: 60, “occurences”: 2, “refresh”: 1800
},
And the handler is a simple pipe:
{
“handlers”:
{
“email”: {
“command”: “python -mjson.tool|mail -v -s ‘Sensu alert’ -r sensu-mail@company.org -S smtp-use-starttls -S ssl-verify=ignore -S smtp-auth=login -S ssl-verify=ignore -S nss-config-dir=/etc/pki/nssdb recipient@company.org”,
“type”: “pipe”
}
}
}
Alerts by e-mail work… but of course ‘occurences’ and ‘refresh’ are being ignored and I get an e-mail per alert per minute…
(on https://sensuapp.org/docs/0.16/handlers, it -DOES- say that " Warning: These trivial (pipe) handlers will not respect the popular refresh
and occurences
settings ",
So I’m not very surprised…
Is there a way to make a the handler a bit ‘smarter’ ? Or alternatively is there a mail handler that only had one of the above ‘gems’ as a requirement and that I could use?
I’m so new to Sensu, I’m a bit at loss…
Thanks for reading,
Vincent S. Cojot