master
md 125 lines 4.21 KB
Rendered Raw
1 <!--startmeta
2 custom_edit_url: "https://github.com/netdata/netdata/edit/master/src/health/notifications/pagerduty/README.md"
3 meta_yaml: "https://github.com/netdata/netdata/edit/master/src/health/notifications/pagerduty/metadata.yaml"
4 sidebar_label: "PagerDuty"
5 learn_status: "Published"
6 learn_rel_path: "Alerts & Notifications/Notifications/Agent Dispatched Notifications"
7 keywords: ['PagerDuty']
8 message: "DO NOT EDIT THIS FILE DIRECTLY, IT IS GENERATED BY THE NOTIFICATION'S metadata.yaml FILE"
9 endmeta-->
10
11 # PagerDuty
12
13
14 <img src="https://netdata.cloud/img/pagerduty.png" width="150"/>
15
16
17 PagerDuty is an enterprise incident resolution service that integrates with ITOps and DevOps monitoring stacks to improve operational reliability and agility. From enriching and aggregating events to correlating them into incidents, PagerDuty streamlines the incident management process by reducing alert noise and resolution times.
18 You can send notifications to PagerDuty using Netdata's Agent alert notification feature, which supports dozens of endpoints, user roles, and more.
19
20
21 <img src="https://img.shields.io/badge/maintained%20by-Netdata-%2300ab44" />
22
23 ## Setup
24
25
26 ### Prerequisites
27
28 ####
29
30 - An installation of the [PagerDuty](https://www.pagerduty.com/docs/guides/agent-install-guide/) Agent on the node running the Netdata Agent
31 - A PagerDuty Generic API service using either the `Events API v2` or `Events API v1`
32 - [Add a new service](https://support.pagerduty.com/docs/services-and-integrations#section-configuring-services-and-integrations) to PagerDuty. Click Use our API directly and select either `Events API v2` or `Events API v1`. Once you finish creating the service, click on the Integrations tab to find your Integration Key.
33 - Access to the terminal where Netdata Agent is running
34
35
36
37 ### Configuration
38
39 #### Options
40
41 The following options can be defined for this notification
42
43 <details open><summary>Config Options</summary>
44
45
46
47 | Option | Description | Default | Required |
48 |:-----|:------------|:--------|:---------:|
49 | SEND_PD | Set `SEND_PD` to YES | YES | yes |
50 | [DEFAULT_RECIPIENT_PD](#option-default-recipient-pd) | Set `DEFAULT_RECIPIENT_PD` to the PagerDuty service key you want the alert notifications to be sent to. You can define multiple service keys like this: `pd_service_key_1` `pd_service_key_2`. | | yes |
51
52 <a id="option-default-recipient-pd"></a>
53 ##### DEFAULT_RECIPIENT_PD
54
55 All roles will default to this variable if left unconfigured.
56
57 The `DEFAULT_RECIPIENT_PD` can be edited in the following entries at the bottom of the same file:
58 ```text
59 role_recipients_pd[sysadmin]="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxa"
60 role_recipients_pd[domainadmin]="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxb"
61 role_recipients_pd[dba]="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxc"
62 role_recipients_pd[webmaster]="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxd"
63 role_recipients_pd[proxyadmin]="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxe"
64 role_recipients_pd[sitemgr]="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxf"
65 ```
66
67
68
69 </details>
70
71
72
73 #### via File
74
75 The configuration file name for this integration is `health_alarm_notify.conf`.
76
77
78 You can edit the configuration file using the [`edit-config`](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#edit-configuration-files) script from the
79 Netdata [config directory](https://github.com/netdata/netdata/blob/master/docs/netdata-agent/configuration/README.md#locate-your-config-directory).
80
81 ```bash
82 cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
83 sudo ./edit-config health_alarm_notify.conf
84 ```
85
86 ##### Examples
87
88 ###### Basic Configuration
89
90
91
92 ```yaml
93 #------------------------------------------------------------------------------
94 # pagerduty.com notification options
95
96 SEND_PD="YES"
97 DEFAULT_RECIPIENT_PD="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
98 USE_PD_VERSION="2"
99
100 ```
101
102
103 ## Troubleshooting
104
105 ### Test Notification
106
107 You can run the following command by hand, to test alerts configuration:
108
109 ```bash
110 # become user netdata
111 sudo su -s /bin/bash netdata
112
113 # enable debugging info on the console
114 export NETDATA_ALARM_NOTIFY_DEBUG=1
115
116 # send test alarms to sysadmin
117 /usr/libexec/netdata/plugins.d/alarm-notify.sh test
118
119 # send test alarms to any role
120 /usr/libexec/netdata/plugins.d/alarm-notify.sh test "ROLE"
121 ```
122
123 Note that this will test _all_ alert mechanisms for the selected role.
124
125