mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Add JiraServiceManagement Transport (#15593)
This commit is contained in:
@@ -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',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -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 isn’t 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/)
|
||||
|
||||
Reference in New Issue
Block a user