Send all available data in pagerduty.com notifications
Jim Cooley committed
Dec 13, 2016 at 18:48 UTC
39fa64139569c17c65dac96d15e64f5aeadfe1cb
1 file changed
+18
-2
plugins.d/alarm-notify.sh
+18
-2
@@ -385,6 +385,7 @@ done
385
[ -z "${PD_SERVICE_KEY}" ] && SEND_PD="NO"
386
387
# if we need pd-send, check for the pd-send command
388
+# https://www.pagerduty.com/docs/guides/agent-install-guide/
389
if [ "${SEND_PD}" = "YES" ]
390
then
391
pd_send="$(which pd-send 2>/dev/null || command -v pd-send 2>/dev/null)"
@@ -677,9 +678,24 @@ send_pd() {
678
-d "${host} ${chart}.${name} is ${status}" \
679
-i ${alarm_id} \
680
-f 'info'="${info}" \
680
- -f 'value'="${value} ${units}" \
681
+ -f 'value_w_units'="${value} ${units}" \
682
-f 'when'="${when}" \
682
- -f 'duration'="${duration}"
683
+ -f 'duration'="${duration}" \
684
+ -f 'roles'="${roles}" \
685
+ -f 'host'="${host}" \
686
+ -f 'unique_id'="${unique_id}" \
687
+ -f 'alarm_id'="${alarm_id}" \
688
+ -f 'event_id'="${event_id}" \
689
+ -f 'name'="${name}" \
690
+ -f 'chart'="${chart}" \
691
+ -f 'family'="${family}" \
692
+ -f 'status'="${status}" \
693
+ -f 'old_status'="${old_status}" \
694
+ -f 'value'="${value}" \
695
+ -f 'old_value'="${old_value}" \
696
+ -f 'src'="${src}" \
697
+ -f 'non_clear_duration'="${non_clear_duration}" \
698
+ -f 'units'="${units}"
699
retval=$?
700
if [ ${retval} -eq 0 ]
701
then