Use correct ID for incident resolution (#9321)

* Use correct ID for incident resolution

* Update Pagerduty.php
This commit is contained in:
Neil Lathwood
2018-10-16 22:38:35 +01:00
committed by Tony Murray
parent 0db8d0ca70
commit 3fc9e334b8

View File

@ -21,6 +21,7 @@
* @package LibreNMS
* @subpackage Alerts
*/
namespace LibreNMS\Alert\Transport;
use GuzzleHttp\Client;
@ -55,7 +56,7 @@ class Pagerduty extends Transport
// This code uses events for PD
$protocol = array(
'service_key' => $opts,
'incident_key' => ($obj['id'] ? $obj['id'] : $obj['uid']),
'incident_key' => $obj['alert_id'],
'description' => ($obj['name'] ? $obj['name'] . ' on ' . $obj['hostname'] : $obj['title']),
'client' => 'LibreNMS',
);
@ -88,7 +89,7 @@ class Pagerduty extends Transport
$data = [
'routing_key' => $config['service_key'],
'event_action' => $obj['event_type'],
'dedup_key' => $obj['uid'],
'dedup_key' => $obj['alert_id'],
'payload' => [
'custom_details' => substr(implode(PHP_EOL, array_column($obj['faults'], 'string')), 0, 1020) . '....' ?: 'Test',
'source' => $obj['hostname'],