mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Use correct ID for incident resolution (#9321)
* Use correct ID for incident resolution * Update Pagerduty.php
This commit is contained in:
committed by
Tony Murray
parent
0db8d0ca70
commit
3fc9e334b8
@ -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'],
|
||||
|
Reference in New Issue
Block a user