Fixed PagerDuty alert to show rule name + device as summary (#9213)

* Fixed PagerDuty alert to show rule name + device as summary

* Update Pagerduty.php
This commit is contained in:
Neil Lathwood
2018-09-19 08:28:50 +01:00
committed by Tony Murray
parent e81a1fc79d
commit 53a1730fc7

View File

@@ -90,9 +90,10 @@ class Pagerduty extends Transport
'event_action' => $obj['event_type'],
'dedup_key' => $obj['uid'],
'payload' => [
'summary' => implode(PHP_EOL, array_column($obj['faults'], 'string')) ?: 'Test',
'custom_details' => substr(implode(PHP_EOL, array_column($obj['faults'], 'string')), 0, 1020) . '....' ?: 'Test',
'source' => $obj['hostname'],
'severity' => $obj['severity'],
'summary' => ($obj['name'] ? $obj['name'] . ' on ' . $obj['hostname'] : $obj['title']),
],
];