FYI, 2-way integrations that depend on the deduplication key to identify alerts in the upstream monitoring system have historically only worked if “create alerts and incidents” is disabled for the service, because the dedup_key
on the incident will be blank (instead, the alerts on the incident have the deduplication keys).
I see however the source code is already halfway to a workaround: retrieving the incident record from the REST API (in subroutine pagerduty_get_event_details
). All you need to do is add the query parameter includel]=alerts
to the URL and then, from the alerts
property in the incident model in the response schema, the subroutine can put together a list of dedup keys from each alert associated with the incident, which can then be used to find and ack any Zabbix alerts that match them.
Good luck and thank you for contributing!
I’ve got it working for my stuff with just included]=body
, but it was definitely finicky (some PD-side configs broke it, such as using the “Zabbix” branded integration)
I have noticed that merging breaks things (“resolves” most of the alerts and only updates the “parent” item after), though we don’t merge often. Sounds like using data fetched via includei]=alerts
might get me to a fix for that issue…
Thanks for the info!
FYI,
This got some major updates… With a PD API key, it will fetch the data it needs (dedup_key) from the PD API.
Also does more than ACKs now:
- reasonably configurable behaviors
- Adds a comment and “signs” it as the PD user that did the action for most actions.
- Can handle incidents and alerts. Can handle multi-problem PD WebHooks.
- Uses a PD API key to get additional info (dedup_key/problem-id)
- when PD gets the alert, add a comment in Zabbix linking to the PD alert/incident
- ACKs in Zabbix when ACK’d in PD
- un-acknowledging in PD un-acks in Zabbix
- any comment (“annotation”) added in PD added as comment in Zabbix
- If resolved in PD, it will try to resolve the problem in Zabbix (sends the API attempt, and only works on manually-closable events)
- If PD “priority” updated, can change the Zabbix problem severity
- If alerts are merged in PD, it sets the “children” as “symptoms” of the “parent” (a “cause”)