Source: https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/media/pagerduty?at=release/7.4

This guide describes how to integrate your Zabbix installation with PagerDuty using the Zabbix webhook feature, providing instructions on setting up a media type, user, and action in Zabbix.
PagerDuty integrations with Zabbix require an Events API v2 key. If you do not have permission to create an Event API v2 key, please reach out to an Admin or Account Owner within your organization to help you configure the integration.
Zabbix version: 7.4 and higher.
After importing the webhook, you can configure it using webhook parameters.
The configurable parameters are intended to be changed according to the webhook setup as well as the user's preferences and environment.
| Name | Value | Description |
|---|---|---|
| zabbix_url | {$ZABBIX.URL} | Current Zabbix URL. |
Internal parameters are reserved for predefined macros that are not meant to be changed.
| Name | Value | Description |
|---|---|---|
| event_source | {EVENT.SOURCE} | Numeric value of the event source. Possible values: 0 - Trigger, 1 - Discovery, 2 - Autoregistration, 3 - Internal, 4 - Service. |
| event_value | {EVENT.VALUE} | Numeric value of the event that triggered an action (1 for problem, 0 for recovering). |
| event_nseverity | {EVENT.NSEVERITY} | Numeric value of the event severity. Possible values: 0 - Not classified, 1 - Information, 2 - Warning, 3 - Average, 4 - High, 5 - Disaster. |
| event_severity | {EVENT.SEVERITY} | Name of the event severity. |
| event_update_nseverity | {EVENT.UPDATE.NSEVERITY} | Numeric value of the event update severity. Possible values: 0 - Not classified, 1 - Information, 2 - Warning, 3 - Average, 4 - High, 5 - Disaster. |
| event_update_severity | {EVENT.UPDATE.SEVERITY} | Name of the event update severity. |
| event_update_status | {EVENT.UPDATE.STATUS} | Numeric value of the problem update status. Possible values: 0 - Webhook was called because of problem/recovery event, 1 - Update operation. |
| alert_subject | {ALERT.SUBJECT} | 'Default subject' value from action configuration. |
| alert_message | {ALERT.MESSAGE} | 'Default message' value from action configuration. |
| event_ack | {EVENT.ACK.STATUS} | Acknowledgment status of the event (Yes/No). |
| event_id | {EVENT.ID} | Numeric ID of the event that triggered an action. |
| trigger_id | {TRIGGER.ID} | Numeric ID of the trigger of this action. |
| host_ip | {HOST.IP} | Host IP address |
| host_name | {HOST.NAME} | Visible host name. |
| api_token | {ALERT.SENDTO} | Integration token that is used to access the PagerDuty HTTP API. |
Please be aware that each webhook supports an HTTP proxy. To use this feature, add a new media type parameter with the name
http_proxyand set its value to the proxy URL.
From the PagerDuty Service menu, select Service Directory.
On your Services page:
If you are adding your integration to an existing service, click the name of the service you want to add the integration to. Then click the Integrations tab and click the +Add an Integration button, select the Zabbix Webhook using the search field, and click Add.
After successfully adding the integration, use its Integration Key in the token macros for the PagerDuty Zabbix media type.
The configuration includes a media type in Zabbix that invokes a webhook to send alerts to PagerDuty through the PagerDuty Event API v2. To use this media type, we will create a Zabbix user to represent PagerDuty and set up an alert action to notify this user whenever a problem is detected.
1. In the Zabbix web interface, go to Administration > Macros.
2. Add the macro {$ZABBIX.URL} with Zabbix frontend URL (for example, http://192.168.7.123:8081).
3. Click the Update button to save.
1. In the Zabbix interface Alerts > Media types section, click the Import button.
2. Select the import file media_pagerduty.yaml and click the Import button at the bottom to import the PagerDuty media type.
1. In the Zabbix interface, go to Users > Users and click the Create user button.
2. Assign the new user the username "PagerDuty User". The default settings should suffice as this user will not be logging into Zabbix.
3. Click the Select button next to Groups.
4. Click on the Media tab and, inside the Media box, click the Add button.
5. In the new window that appears, configure the media for the user as follows:
6. Click the Add button at the bottom of the user page to save the user.
7. Use the PagerDuty User in any actions of your choice.
For more information, please see the Zabbix and PagerDuty documentation.
Please report any issues with the media type at https://support.zabbix.com.
You can also provide feedback, discuss the media type, or ask for help at ZABBIX forums.