-
Notifications
You must be signed in to change notification settings - Fork 9
Update icinga_state_change_events.py #11
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
Conversation
Add a variable in the payload sensor to easily differenciate host and service type for a state change Signed-off-by: Atlantis Boengkih <atlantis.boengkih@blade-group.com>
|
I'm not too familiar with this pack or service, will the event JSON ever have both |
|
The event generated by Icinga is either a service event or a host event, it can not be both. |
blag
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a backwards-compatible change, right? Previously both the service and host keys would exist in the payload, but now only one will. This could break rules that already exist and rely on both keys existing (even if one of them isn't useful).
I think I'd like to maintain backwards compatibility (eg: keep both service and host keys in payload), and simply add a key (eg: check_type) that makes it easier to query.
Pulling in @armab, since he might have some opinions on this.
|
I'm good with the @blag request to keep the backwards compatibility, if possible. |
| payload['host'] = event['host'] | ||
| if 'service' in event: | ||
| payload['service'] = event['service'] | ||
| payload['check_type'] = 'service' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@atl-tortue, we can add the host line in the service block and it will ensure backward compatibility and prevent exceptions being raised for host event types.
if 'service' in event:
payload['host'] = event['host']
payload['service'] = event['service']
payload['check_type'] = 'service'
|
|
|
Closing due to PR being abandoned. |
Signed-off-by: Atlantis Boengkih atlantis.boengkih@blade-group.com