Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sense::handler creates deprecated "Filters" entry in resulting yaml #620

Closed
Justin-DynamicD opened this issue Mar 16, 2017 · 2 comments
Closed

Comments

@Justin-DynamicD
Copy link

when attempting to create the sample handler:
sensu::handler { 'slack': type => 'pipe', command => "/opt/sensu/embedded/bin/handler-slack.rb", config => { 'webhook_url' => 'https://hooks.slack.com/services/###/###/###', 'template' => '', } }

the resulting created yaml will contain an empty "filter" entry. Despite being empty, this causes the same error to repeat in the sensu logs while evaluating the handler:

{"timestamp":"2017-03-16T09:41:35.902187-0700","level":"info","message":"handler output","handler":{"command":"/opt/sensu/embedded/bin/handler-slack.rb","type":"pipe","filters":[],"severities":["ok","warning","critical","unknown"],"name":"slack"},"output":["warning: event filtering in sensu-plugin is deprecated, see http://bit.ly/sensu-plugin\nwarning: occurrence filtering in sensu-plugin is deprecated, see http://bit.ly/sensu-plugin\nonly handling every 30 occurrences:"]}

Manually editing the yaml and pulling out the empty filters entry suppress the message, but it seems like something that should likely be cleaned out.

@cwjohnston
Copy link
Contributor

Hi @Justin-DynamicD, the filter deprecation warnings you describe are a product of changes in the sensu-plugin library, and are not related to the presence or absence of filters in the handler definition.

Please see https://sensuapp.org/blog/2016/07/07/sensu-plugin-filter-deprecation.html for an in-depth description of this situation.

Manually editing the yaml and pulling out the empty filters entry suppress the message

I think it is more likely that your next test event had a sufficient number of occurrences to qualify for being handled.

@Justin-DynamicD
Copy link
Author

Justin-DynamicD commented Mar 16, 2017

perhaps my explanation is poor, but the link provided describes the exact problem as well as my suggestion: eventually remove the filtering from sensu::handler, so it sounds like it's being worked on.

To clarify, however: Even if the resulting value is left empty, merely declaring "filters" in the handler yaml file will generate the warning in the sensu-server log. So while it may not be the "root cause", the way sensu::handler generates it's yaml causes the "filters" to always be defined in the yaml and thus the warning to always appear in the log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants