Add JiraServiceManagement Transport (#15593)

This commit is contained in:
Hamza Khan
2024-01-08 16:49:14 +01:00
committed by GitHub
parent 421f2c7d38
commit 166026d251
2 changed files with 57 additions and 0 deletions
@@ -0,0 +1,40 @@
<?php
namespace LibreNMS\Alert\Transport;
use LibreNMS\Alert\Transport;
use LibreNMS\Exceptions\AlertTransportDeliveryException;
use LibreNMS\Util\Http;
class JiraServiceManagement extends Transport
{
public function deliverAlert(array $alert_data): bool
{
$url = $this->config['jsm-url'];
$res = Http::client()->post($url, $alert_data);
if ($res->successful()) {
return true;
}
throw new AlertTransportDeliveryException($alert_data, $res->status(), $res->body(), '', $alert_data);
}
public static function configTemplate(): array
{
return [
'config' => [
[
'title' => 'Webhook URL',
'name' => 'jsm-url',
'descr' => 'Jira Service Management Webhook URL',
'type' => 'text',
],
],
'validation' => [
'jsm-url' => 'required|url',
],
];
}
}
+17
View File
@@ -363,6 +363,23 @@ LibreNMS database.
| Jira Username | myjirauser |
| Jira Password | myjirapass |
## Jira Service Management
Using Jira Service Management LibreNMS integration, LibreNMS forwards alerts to
Jira Service Management with detailed information. Jira Service Management acts as a dispatcher for
LibreNMS alerts, determines the right people to notify based on
on-call schedules and notifies via email, text messages (SMS), phone
calls and iOS & Android push notifications. Then escalates alerts
until the alert is acknowledged or closed.
:warning: If the feature isnt available on your site, keep checking Jira Service Management for updates.
**Example:**
| Config | Example |
| ------ | ------- |
| WebHook URL | <https://url/path/to/webhook> |
## LINE Messaging API
[LINE Messaging API Docs](https://developers.line.biz/en/docs/messaging-api/overview/)