-
Notifications
You must be signed in to change notification settings - Fork 290
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
Unable to define handler specific config properly #647
Comments
|
write_json should solve this. If it doesn't, I'll make a new issue. |
|
Ran into this while trying to add a filter to my handler, if write_json solves this then why have the sensu::handler feature? I would like to propose that this bug at least be reopened. |
|
@johannagnarsson, could you add steps to reproduce this issue, along with As |
|
@johannagnarsson please use the latest version of this module and let us know how it goes as @rgeniesse suggested. We're looking forward to your response and happy to help get this resolved. |
|
Hello @rgeniesse, @ghoneycutt thank you for your responses. Command used and debugging output Is this a masterless or master based puppet setup? Platform and version information Latest version of sensu puppet module: Here is the puppet snippet of the handler definition: And this is the config file that was written out (/etc/sensu/conf.d/handlers/logstash.json): Filter definition: I have another handler defined as well: File written out (/etc/sensu/conf.d/handlers/webex.json): Please let me know if there's any additional information I could provide! Also, I can open a new ticket if that would be more helpful! |
|
@johannagnarsson what outputs were you expecting? |
|
This is a correct handler, created by write_json: Webex: Note how the filters isn't empty under "handlers": { "logstash": { "filters": [ ] } } and how there isn't a separate "logstash": { "filters": [] } } definition. |
|
The above shows logstash while the previous example used webex. Could you please show the expectation for webex? This allows us to make a diff and debug the issue. |
|
Sorry , I included both in the first comment, I'll add webex to the previous comment as well |
|
@johannagnarsson Try using include ::sensu
sensu::handler { 'logstash':
type => 'tcp',
socket => {
'host' => 'localhost',
'port' => '8000',
},
filters => [ 'state_change_only' ],
}
sensu::handler {'webex':
type => 'pipe',
command => '/opt/sensu/embedded/bin/handler-webex.py',
filters => [ 'state_change_only' ],
}{
"handlers": {
"logstash": {
"command": null,
"type": "tcp",
"socket": {
"host": "localhost",
"port": 8000
},
"filters": [
"state_change_only"
],
"severities": [
"ok",
"warning",
"critical",
"unknown"
],
"handle_flapping": false,
"handle_silenced": false
}
}
}
{
"handlers": {
"webex": {
"command": "/opt/sensu/embedded/bin/handler-webex.py",
"type": "pipe",
"filters": [
"state_change_only"
],
"severities": [
"ok",
"warning",
"critical",
"unknown"
],
"handle_flapping": false,
"handle_silenced": false
}
}
} |
|
Thanks @treydock ! @johannagnarsson let us know how this goes. |
|
Closing due to inactivity. Please re-open if this is still an issue and @treydock 's comments did not solve it. |
Description of problem
What did you do?
Attempted to use the config hash in
handler.pp.What happened?
The module repeats the name of the handler instead of adding the custom config to the current one. Example:
Becomes
I expected the code to turn out like this, order doesn't matter, just under the same handle scope:
I reproduced it both inside the manifest and through hiera. Hiera code:
Puppet code:
Command used and debugging output
See above
master based
Platform and version information
Anything else to add that you think will be helpful?
The text was updated successfully, but these errors were encountered: