Hi All,
We use filters by occurrences in order to filter unnecessary alerts. But the problem is that I don’t receive OK messages in this case. My assumption is that ok messages are filteres as well as other by occurrence.
Here is the example of resolve message from logs:
{“timestamp”:“2016-09-30T11:12:06.381458+0300”,“level”:“info”,“message”:“event was filtered”,“handler”:{“type”:“pipe”,“command”:“handler-slack.rb -j slack_jenkins”,“channel”:“alerts-sensu”,“severites”:[“unknown”,“warning”,“critical”],“filters”:[“recurrence_5_1440”],“name”:“slack_jenkins_handler”},“event”:{“client”:{“name”:“node009-jenkins-prod”,“address”:“192.168.81.2”,“subscriptions”:[“common”,“infra”,“infra_prod”],“keepalive”:{“handlers”:[“slack”],“interval”:60,“refresh”:60},“version”:“0.25.2”,“timestamp”:1475223115},“check”:{“command”:"/etc/sensu/plugins/check-jenkins-job-status.rb -u http://node009-jenkins-prod:8080 -j ansible-tests -l jenkins_api -p /opt/sensu/.sensu_jenkins_api",“interval”:60,“handlers”:[“slack_jenkins_handler”],“source”:“node009-jenkins-prod”,“subscribers”:[“infra_prod_sensu_masters”],“refresh”:60,“name”:“jenkins_job_ansible_tests”,“issued”:1475223125,“executed”:1475223125,“duration”:0.865,“output”:“JenkinsJobChecker OK: All queried jobs reports success\n”,“status”:0,“type”:“standard”,“origin”:“sensu-server001-prod”,“history”:[“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“2”,“0”],“total_state_change”:6},“occurrences”:45,“action”:“resolve”,“timestamp”:1475223126,“id”:“3f2d92b3-c4d7-4459-81da-7c5e4c69d6c0”,“last_state_change”:1475223126,“last_ok”:1475223126}}
“recurrence_5_1440”: {
“attributes”: {
“occurrences”: “eval: value == 5 || value % 1440 == 0”
}
Is there any workaround to filter unnecessary alerts but still receive OK messages?
Thanks,
Alexey