mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added Discord transport (#8748)
DO NOT DELETE THIS TEXT #### Please note > Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting. - [x] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/) #### Testers If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
This commit is contained in:
committed by
Neil Lathwood
parent
9ae1485a09
commit
a6c328925c
64
LibreNMS/Alert/Transport/Discord.php
Normal file
64
LibreNMS/Alert/Transport/Discord.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
/**
|
||||
* Discord.php
|
||||
*
|
||||
* LibreNMS Discord API Tranport
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* @package LibreNMS
|
||||
* @link http://librenms.org
|
||||
* @copyright 2018 Ryan Finney
|
||||
* @author https://github.com/theherodied/
|
||||
* @contributer f0o, sdef2
|
||||
* Thanks to F0o <f0o@devilcode.org> for creating the Slack transport which is the majority of this code.
|
||||
* Thanks to sdef2 for figuring out the differences needed to make Discord work.
|
||||
*/
|
||||
namespace LibreNMS\Alert\Transport;
|
||||
|
||||
use LibreNMS\Interfaces\Alert\Transport;
|
||||
|
||||
class Discord implements Transport
|
||||
{
|
||||
public function deliverAlert($obj, $opts)
|
||||
{
|
||||
foreach ($opts as $tmp_api) {
|
||||
$host = $tmp_api['url'];
|
||||
$curl = curl_init();
|
||||
$discord_msg = strip_tags($obj['msg']);
|
||||
$color = ($obj['state'] == 0 ? '#00FF00' : '#FF0000');
|
||||
$data = array(
|
||||
'username'=>$tmp_api['username'],
|
||||
'content' => "". $obj['title'] ."\n" . $discord_msg
|
||||
);
|
||||
$alert_message = json_encode($data);
|
||||
curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
|
||||
set_curl_proxy($curl);
|
||||
curl_setopt($curl, CURLOPT_URL, $host);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($curl, CURLOPT_POST, true);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $alert_message);
|
||||
|
||||
$ret = curl_exec($curl);
|
||||
$code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
||||
if ($code != 204) {
|
||||
var_dump("API '$host' returned Error"); //FIXME: propper debuging
|
||||
var_dump("Params: " . $alert_message); //FIXME: propper debuging
|
||||
var_dump("Return: " . $ret); //FIXME: propper debuging
|
||||
return 'HTTP Status code ' . $code;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
@@ -24,6 +24,124 @@ $config['alert']['globals'] = true; //Include Global-Read into alert-contacts
|
||||
$config['alert']['admins'] = true; //Include Administrators into alert-contacts
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
> You can configure these options within the WebUI now, please avoid setting these options within config.php
|
||||
|
||||
API transports definitions are a bit more complex than the E-Mail configuration.
|
||||
The basis for configuration is ~~`$config['alert']['transports']['api'][METHOD]`~~ where `METHOD` can be `get`,`post` or `put`.
|
||||
This basis has to contain an array with URLs of each API to call.
|
||||
The URL can have the same placeholders as defined in the [Template-Syntax](Templates#syntax).
|
||||
If the `METHOD` is `get`, all placeholders will be URL-Encoded.
|
||||
The API transport uses cURL to call the APIs, therefore you might need to install `php5-curl` or similar in order to make it work.
|
||||
__Note__: it is highly recommended to define own [Templates](Templates) when you want to use the API transport. The default template might exceed URL-length for GET requests and therefore cause all sorts of errors.
|
||||
|
||||
Example:
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['api']['get'][] = "https://api.thirdparti.es/issue?apikey=abcdefg&subject=%title";
|
||||
```
|
||||
|
||||
## Boxcar
|
||||
|
||||
[Using a proxy?](../Support/Configuration.md#proxy-support)
|
||||
|
||||
Enabling Boxcar support is super easy.
|
||||
Copy your access token from the Boxcar app or from the Boxcar.io website and setup the transport in your config.php like:
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['boxcar'][] = array(
|
||||
"access_token" => 'ACCESSTOKENGOESHERE',
|
||||
);
|
||||
```
|
||||
|
||||
To modify the Critical alert sound, add the 'sound_critical' parameter, example:
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['boxcar'][] = array(
|
||||
"access_token" => 'ACCESSTOKENGOESHERE',
|
||||
"sound_critical" => 'detonator-charge',
|
||||
);
|
||||
```
|
||||
|
||||
## Canopsis
|
||||
|
||||
Canopsis is a hypervision tool. LibreNMS can send alerts to Canopsis which are then converted to canopsis events. To configure the transport, go to:
|
||||
|
||||
Global Settings -> Alerting Settings -> Canopsis Transport.
|
||||
|
||||
You will need to fill this paramaters :
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['canopsis']['host'] = 'www.xxx.yyy.zzz';
|
||||
$config['alert']['transports']['canopsis']['port'] = '5672';
|
||||
$config['alert']['transports']['canopsis']['user'] = 'admin';
|
||||
$config['alert']['transports']['canopsis']['passwd'] = 'my_password';
|
||||
$config['alert']['transports']['canopsis']['vhost'] = 'canopsis';
|
||||
```
|
||||
|
||||
For more information about canopsis and its events, take a look here :
|
||||
http://www.canopsis.org/
|
||||
http://www.canopsis.org/wp-content/themes/canopsis/doc/sakura/user-guide/event-spec.html
|
||||
|
||||
## Cisco Spark
|
||||
|
||||
[Using a proxy?](../Support/Configuration.md#proxy-support)
|
||||
|
||||
|
||||
Cisco Spark. LibreNMS can send alerts to a Cisco Spark room. To make this possible you need to have a RoomID and a token.
|
||||
|
||||
For more information about Cisco Spark RoomID and token, take a look here :
|
||||
https://developer.ciscospark.com/getting-started.html
|
||||
https://developer.ciscospark.com/resource-rooms.html
|
||||
|
||||
To configure the transport, go to:
|
||||
|
||||
Global Settings -> Alerting Settings -> Cisco Spark transport.
|
||||
|
||||
This can also be done manually in config.php :
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['ciscospark']['token'] = '1234567890QWERTYUIOP';
|
||||
$config['alert']['transports']['ciscospark']['roomid'] = '1234567890QWERTYUIOP';
|
||||
```
|
||||
|
||||
## Clickatell
|
||||
|
||||
[Using a proxy?](../Support/Configuration.md#proxy-support)
|
||||
|
||||
Clickatell provides a REST-API requiring an Authorization-Token and at least one Cellphone number.
|
||||
Please consult Clickatell's documentation regarding number formatting.
|
||||
Here an example using 3 numbers, any amount of numbers is supported:
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['clickatell']['token'] = 'MYFANCYACCESSTOKEN';
|
||||
$config['alert']['transports']['clickatell']['to'][] = '+1234567890';
|
||||
$config['alert']['transports']['clickatell']['to'][] = '+1234567891';
|
||||
$config['alert']['transports']['clickatell']['to'][] = '+1234567892';
|
||||
```
|
||||
|
||||
## Discord
|
||||
|
||||
The Discord transport will POST the alert message to your Discord Incoming WebHook (https://discordapp.com/developers/docs/resources/webhook). Simple html tags are stripped from the message. The only required value is for url, without this no call to Discord will be made. Below is an example webhook url:
|
||||
|
||||
```
|
||||
https://discordapp.com/api/webhooks/4515489001665127664/82-sf4385ysuhfn34u2fhfsdePGLrg8K7cP9wl553Fg6OlZuuxJGaa1d54fe
|
||||
```
|
||||
|
||||
## Elasticsearch
|
||||
|
||||
You can have LibreNMS emit alerts to an elasticsearch database. Each fault will be sent as a separate document.
|
||||
The index pattern uses strftime() formatting.
|
||||
The proxy setting uses the proxy set in config.php if true and does not if false; this allows you to use local servers.
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['elasticsearch']['es_host'] = '127.0.0.1';
|
||||
$config['alert']['transports']['elasticsearch']['es_port'] = 9200;
|
||||
$config['alert']['transports']['elasticsearch']['es_index'] = 'librenms-%Y.%m.%d';
|
||||
$config['alert']['transports']['elasticsearch']['es_proxy'] = false;
|
||||
```
|
||||
|
||||
## E-Mail
|
||||
|
||||
> You can configure these options within the WebUI now, please avoid setting these options within config.php
|
||||
@@ -59,69 +177,14 @@ $config['alert']['default_only'] = false; //Only issue
|
||||
$config['alert']['default_mail'] = ''; //Default email
|
||||
```
|
||||
|
||||
## API
|
||||
## Gitlab
|
||||
|
||||
> You can configure these options within the WebUI now, please avoid setting these options within config.php
|
||||
|
||||
API transports definitions are a bit more complex than the E-Mail configuration.
|
||||
The basis for configuration is ~~`$config['alert']['transports']['api'][METHOD]`~~ where `METHOD` can be `get`,`post` or `put`.
|
||||
This basis has to contain an array with URLs of each API to call.
|
||||
The URL can have the same placeholders as defined in the [Template-Syntax](Templates#syntax).
|
||||
If the `METHOD` is `get`, all placeholders will be URL-Encoded.
|
||||
The API transport uses cURL to call the APIs, therefore you might need to install `php5-curl` or similar in order to make it work.
|
||||
__Note__: it is highly recommended to define own [Templates](Templates) when you want to use the API transport. The default template might exceed URL-length for GET requests and therefore cause all sorts of errors.
|
||||
|
||||
Example:
|
||||
LibreNMS will create issues for warning and critical level alerts however only title and description are set. Uses Personal access tokens to authenticate with Gitlab and will store the token in cleartext.
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['api']['get'][] = "https://api.thirdparti.es/issue?apikey=abcdefg&subject=%title";
|
||||
```
|
||||
|
||||
## Nagios Compatible
|
||||
|
||||
> You can configure these options within the WebUI now, please avoid setting these options within config.php
|
||||
|
||||
The nagios transport will feed a FIFO at the defined location with the same format that nagios would.
|
||||
This allows you to use other Alerting-Systems to work with LibreNMS, for example [Flapjack](http://flapjack.io).
|
||||
```php
|
||||
$config['alert']['transports']['nagios'] = "/path/to/my.fifo"; //Flapjack expects it to be at '/var/cache/nagios3/event_stream.fifo'
|
||||
```
|
||||
|
||||
## IRC
|
||||
|
||||
> You can configure these options within the WebUI now, please avoid setting these options within config.php
|
||||
|
||||
The IRC transports only works together with the LibreNMS IRC-Bot.
|
||||
Configuration of the LibreNMS IRC-Bot is described [here](https://github.com/librenms/librenms/blob/master/doc/Extensions/IRC-Bot.md).
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['irc'] = true;
|
||||
```
|
||||
|
||||
## Slack
|
||||
|
||||
> You can configure these options within the WebUI now, please avoid setting these options within config.php
|
||||
|
||||
[Using a proxy?](../Support/Configuration.md#proxy-support)
|
||||
|
||||
The Slack transport will POST the alert message to your Slack Incoming WebHook using the [attachments](https://api.slack.com/docs/message-attachments) option, you are able to specify multiple webhooks along with the relevant options to go with it. Simple html tags are stripped from the message. All options are optional, the only required value is for url, without this then no call to Slack will be made. Below is an example of how to send alerts to two channels with different customised options:
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['slack'][] = array('url' => "https://hooks.slack.com/services/A12B34CDE/F56GH78JK/L901LmNopqrSTUVw2w3XYZAB4C", 'channel' => '#Alerting');
|
||||
|
||||
$config['alert']['transports']['slack'][] = array('url' => "https://hooks.slack.com/services/A12B34CDE/F56GH78JK/L901LmNopqrSTUVw2w3XYZAB4C", 'channel' => '@john', 'username' => 'LibreNMS', 'icon_emoji' => ':ghost:');
|
||||
```
|
||||
|
||||
## Rocket.chat
|
||||
|
||||
[Using a proxy?](../Support/Configuration.md#proxy-support)
|
||||
|
||||
The Rocket.chat transport will POST the alert message to your Rocket.chat Incoming WebHook using the [attachments](https://rocket.chat/docs/developer-guides/rest-api/chat/postmessage) option, you are able to specify multiple webhooks along with the relevant options to go with it. Simple html tags are stripped from the message. All options are optional, the only required value is for url, without this then no call to Rocket.chat will be made. Below is an example of how to send alerts to two channels with different customised options:
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['rocket'][] = array('url' => "https://rocket.url/api/v1/chat.postMessage", 'channel' => '#Alerting');
|
||||
|
||||
$config['alert']['transports']['rocket'][] = array('url' => "https://rocket.url/api/v1/chat.postMessage", 'channel' => '@john', 'username' => 'LibreNMS', 'icon_emoji' => ':ghost:');
|
||||
$config['alert']['transports']['gitlab']['host'] = 'http://gitlab.host.tld';
|
||||
$config['alert']['transports']['gitlab']['project_id'] = '1';
|
||||
$config['alert']['transports']['gitlab']['key'] = 'AbCdEf12345';
|
||||
```
|
||||
|
||||
## HipChat
|
||||
@@ -176,6 +239,54 @@ These settings can also be configured from the WebUI, here's an example used for
|
||||
> results, such as HipChat attempting to interpret angled brackets (`<` and
|
||||
> `>`).
|
||||
|
||||
## IRC
|
||||
|
||||
> You can configure these options within the WebUI now, please avoid setting these options within config.php
|
||||
|
||||
The IRC transports only works together with the LibreNMS IRC-Bot.
|
||||
Configuration of the LibreNMS IRC-Bot is described [here](https://github.com/librenms/librenms/blob/master/doc/Extensions/IRC-Bot.md).
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['irc'] = true;
|
||||
```
|
||||
|
||||
## JIRA
|
||||
|
||||
You can have LibreNMS create issues on a Jira instance for critical and warning alerts. The Jira transport only sets summary and description fiels. Therefore your Jira project must not have any other mandatory field for the provided issuetype. The config fields that need to set are Jira URL, Jira username, Jira password, Project key, and issue type.
|
||||
Currently http authentication is used to access Jira and Jira username and password will be stored as cleartext in the LibreNMS database.
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['jira']['url'] = 'https://myjira.mysite.com';
|
||||
$config['alert']['transports']['jira']['username'] = 'myjirauser';
|
||||
$config['alert']['transports']['jira']['password'] = 'myjirapass';
|
||||
$config['alert']['transports']['jira']['prjkey'][] = 'JIRAPROJECTKEY';
|
||||
$config['alert']['transports']['jira']['issuetype'][] = 'Myissuetype';
|
||||
```
|
||||
|
||||
## Microsoft Teams
|
||||
|
||||
[Using a proxy?](../Support/Configuration.md#proxy-support)
|
||||
|
||||
Microsoft Teams. LibreNMS can send alerts to Microsoft Teams Connector API which are then posted to a specific channel. To configure the transport, go to:
|
||||
|
||||
Global Settings -> Alerting Settings -> Microsoft Teams Transport.
|
||||
|
||||
This can also be done manually in config.php :
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['msteams']['url'] = 'https://outlook.office365.com/webhook/123456789';
|
||||
```
|
||||
|
||||
## Nagios Compatible
|
||||
|
||||
> You can configure these options within the WebUI now, please avoid setting these options within config.php
|
||||
|
||||
The nagios transport will feed a FIFO at the defined location with the same format that nagios would.
|
||||
This allows you to use other Alerting-Systems to work with LibreNMS, for example [Flapjack](http://flapjack.io).
|
||||
```php
|
||||
$config['alert']['transports']['nagios'] = "/path/to/my.fifo"; //Flapjack expects it to be at '/var/cache/nagios3/event_stream.fifo'
|
||||
```
|
||||
|
||||
## OpsGenie
|
||||
|
||||
> You can configure these options within the WebUI now, please avoid setting these options within config.php
|
||||
@@ -188,6 +299,21 @@ Create a [LibreNMS Integration](https://docs.opsgenie.com/docs/librenms-integrat
|
||||
|
||||
If you want to automatically ack and close alerts, leverage Marid integration. More detail with screenshots is available in [OpsGenie LibreNMS Integration page](https://docs.opsgenie.com/docs/librenms-integration).
|
||||
|
||||
## osTicket
|
||||
|
||||
[Using a proxy?](../Support/Configuration.md#proxy-support)
|
||||
|
||||
osTicket, open source ticket system. LibreNMS can send alerts to osTicket API which are then converted to osTicket tickets. To configure the transport, go to:
|
||||
|
||||
Global Settings -> Alerting Settings -> osTicket Transport.
|
||||
|
||||
This can also be done manually in config.php :
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['osticket']['url'] = 'http://osticket.example.com/api/http.php/tickets.json';
|
||||
$config['alert']['transports']['osticket']['token'] = '123456789';
|
||||
```
|
||||
|
||||
## PagerDuty
|
||||
|
||||
> You can configure these options within the WebUI now, please avoid setting these options within config.php
|
||||
@@ -208,6 +334,55 @@ That's it!
|
||||
|
||||
__Note__: Currently ACK notifications are not transported to PagerDuty, This is going to be fixed within the next major version (version by date of writing: 2015.05)
|
||||
|
||||
## Philips Hue
|
||||
|
||||
Want to spice up your noc life? LibreNMS will flash all lights connected to your philips hue bridge whenever an alert is triggered.
|
||||
|
||||
To setup, go to the you http://`your-bridge-ip`/debug/clip.html
|
||||
|
||||
- Update the "URL:" field to `/api`
|
||||
- Paste this in the "Message Body" {"devicetype":"librenms"}
|
||||
- Press the round button on your `philips Hue Bridge`
|
||||
- Click on `POST`
|
||||
- In the `Command Response` You should see output with your username. Copy this without the quotes
|
||||
|
||||
|
||||
More Info: [Philips Hue Documentation](https://www.developers.meethue.com/documentation/getting-started)
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['hue']['bridge'] = 'http://bridge.example.com';
|
||||
$config['alert']['transports']['hue']['user'] = 'af89jauaf98aj34r';
|
||||
$config['alert']['transports']['hue']['duration'] = 'lselect';
|
||||
```
|
||||
|
||||
## PlaySMS
|
||||
|
||||
[Using a proxy?](../Support/Configuration.md#proxy-support)
|
||||
|
||||
PlaySMS is an open source SMS-Gateway that can be used via their HTTP-API using a Username and WebService-Token.
|
||||
Please consult PlaySMS's documentation regarding number formatting.
|
||||
Here an example using 3 numbers, any amount of numbers is supported:
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['playsms']['url'] = 'https://localhost/index.php?app=ws';
|
||||
$config['alert']['transports']['playsms']['user'] = 'user1';
|
||||
$config['alert']['transports']['playsms']['token'] = 'MYFANCYACCESSTOKEN';
|
||||
$config['alert']['transports']['playsms']['from'] = '+1234567892'; //Optional
|
||||
$config['alert']['transports']['playsms']['to'][] = '+1234567890';
|
||||
$config['alert']['transports']['playsms']['to'][] = '+1234567891';
|
||||
```
|
||||
|
||||
## Pushbullet
|
||||
|
||||
[Using a proxy?](../Support/Configuration.md#proxy-support)
|
||||
|
||||
Enabling Pushbullet is a piece of cake.
|
||||
Get your Access Token from your Pushbullet's settings page and set it in your config like:
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['pushbullet'] = 'MYFANCYACCESSTOKEN';
|
||||
```
|
||||
|
||||
## Pushover
|
||||
|
||||
[Using a proxy?](../Support/Configuration.md#proxy-support)
|
||||
@@ -243,176 +418,30 @@ $config['alert']['transports']['pushover'][] = array(
|
||||
);
|
||||
```
|
||||
|
||||
## Boxcar
|
||||
## Rocket.chat
|
||||
|
||||
[Using a proxy?](../Support/Configuration.md#proxy-support)
|
||||
|
||||
Enabling Boxcar support is super easy.
|
||||
Copy your access token from the Boxcar app or from the Boxcar.io website and setup the transport in your config.php like:
|
||||
The Rocket.chat transport will POST the alert message to your Rocket.chat Incoming WebHook using the [attachments](https://rocket.chat/docs/developer-guides/rest-api/chat/postmessage) option, you are able to specify multiple webhooks along with the relevant options to go with it. Simple html tags are stripped from the message. All options are optional, the only required value is for url, without this then no call to Rocket.chat will be made. Below is an example of how to send alerts to two channels with different customised options:
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['boxcar'][] = array(
|
||||
"access_token" => 'ACCESSTOKENGOESHERE',
|
||||
);
|
||||
$config['alert']['transports']['rocket'][] = array('url' => "https://rocket.url/api/v1/chat.postMessage", 'channel' => '#Alerting');
|
||||
|
||||
$config['alert']['transports']['rocket'][] = array('url' => "https://rocket.url/api/v1/chat.postMessage", 'channel' => '@john', 'username' => 'LibreNMS', 'icon_emoji' => ':ghost:');
|
||||
```
|
||||
|
||||
To modify the Critical alert sound, add the 'sound_critical' parameter, example:
|
||||
## Slack
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['boxcar'][] = array(
|
||||
"access_token" => 'ACCESSTOKENGOESHERE',
|
||||
"sound_critical" => 'detonator-charge',
|
||||
);
|
||||
```
|
||||
|
||||
## Telegram
|
||||
> You can configure these options within the WebUI now, please avoid setting these options within config.php
|
||||
|
||||
[Using a proxy?](../Support/Configuration.md#proxy-support)
|
||||
|
||||
> Thank you to [snis](https://github.com/snis) for these instructions.
|
||||
|
||||
1. First you must create a telegram account and add BotFather to you list. To do this click on the following url: https://telegram.me/botfather
|
||||
|
||||
2. Generate a new bot with the command "/newbot" BotFather is then asking for a username and a normal name. After that your bot is created and you get a HTTP token. (for more options for your bot type "/help")
|
||||
|
||||
3. Add your bot to telegram with the following url: `http://telegram.me/<botname>` and send some text to the bot.
|
||||
|
||||
4. Now copy your token code and go to the following page in chrome: `https://api.telegram.org/bot<tokencode>/getUpdates`
|
||||
|
||||
5. You see a json code with the message you sent to the bot. Copy the Chat id. In this example that is “-9787468”
|
||||
`"message":{"message_id":7,"from":"id":656556,"first_name":"Joo","last_name":"Doo","username":"JohnDoo"},"chat":{"id":-9787468,"title":"Telegram Group"},"date":1435216924,"text":"Hi"}}]}`
|
||||
|
||||
6. Now create a new "Telegram transport" in LibreNMS (Global Settings -> Alerting Settings -> Telegram transport).
|
||||
Click on 'Add Telegram config' and put your chat id and token into the relevant box.
|
||||
|
||||
## Pushbullet
|
||||
|
||||
[Using a proxy?](../Support/Configuration.md#proxy-support)
|
||||
|
||||
Enabling Pushbullet is a piece of cake.
|
||||
Get your Access Token from your Pushbullet's settings page and set it in your config like:
|
||||
The Slack transport will POST the alert message to your Slack Incoming WebHook using the [attachments](https://api.slack.com/docs/message-attachments) option, you are able to specify multiple webhooks along with the relevant options to go with it. Simple html tags are stripped from the message. All options are optional, the only required value is for url, without this then no call to Slack will be made. Below is an example of how to send alerts to two channels with different customised options:
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['pushbullet'] = 'MYFANCYACCESSTOKEN';
|
||||
```
|
||||
$config['alert']['transports']['slack'][] = array('url' => "https://hooks.slack.com/services/A12B34CDE/F56GH78JK/L901LmNopqrSTUVw2w3XYZAB4C", 'channel' => '#Alerting');
|
||||
|
||||
## Clickatell
|
||||
|
||||
[Using a proxy?](../Support/Configuration.md#proxy-support)
|
||||
|
||||
Clickatell provides a REST-API requiring an Authorization-Token and at least one Cellphone number.
|
||||
Please consult Clickatell's documentation regarding number formatting.
|
||||
Here an example using 3 numbers, any amount of numbers is supported:
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['clickatell']['token'] = 'MYFANCYACCESSTOKEN';
|
||||
$config['alert']['transports']['clickatell']['to'][] = '+1234567890';
|
||||
$config['alert']['transports']['clickatell']['to'][] = '+1234567891';
|
||||
$config['alert']['transports']['clickatell']['to'][] = '+1234567892';
|
||||
```
|
||||
|
||||
## PlaySMS
|
||||
|
||||
[Using a proxy?](../Support/Configuration.md#proxy-support)
|
||||
|
||||
PlaySMS is an open source SMS-Gateway that can be used via their HTTP-API using a Username and WebService-Token.
|
||||
Please consult PlaySMS's documentation regarding number formatting.
|
||||
Here an example using 3 numbers, any amount of numbers is supported:
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['playsms']['url'] = 'https://localhost/index.php?app=ws';
|
||||
$config['alert']['transports']['playsms']['user'] = 'user1';
|
||||
$config['alert']['transports']['playsms']['token'] = 'MYFANCYACCESSTOKEN';
|
||||
$config['alert']['transports']['playsms']['from'] = '+1234567892'; //Optional
|
||||
$config['alert']['transports']['playsms']['to'][] = '+1234567890';
|
||||
$config['alert']['transports']['playsms']['to'][] = '+1234567891';
|
||||
```
|
||||
|
||||
## VictorOps
|
||||
|
||||
[Using a proxy?](../Support/Configuration.md#proxy-support)
|
||||
|
||||
VictorOps provide a webHook url to make integration extremely simple. To get the URL required login to your VictorOps account and go to:
|
||||
|
||||
Settings -> Integrations -> REST Endpoint -> Enable Integration.
|
||||
|
||||
The URL provided will have $routing_key at the end, you need to change this to something that is unique to the system sending the alerts such as librenms. I.e:
|
||||
|
||||
`https://alert.victorops.com/integrations/generic/20132414/alert/2f974ce1-08fc-4dg8-a4f4-9aee6cf35c98/librenms`
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['victorops']['url'] = 'https://alert.victorops.com/integrations/generic/20132414/alert/2f974ce1-08fc-4dg8-a4f4-9aee6cf35c98/librenms';
|
||||
```
|
||||
|
||||
## Canopsis
|
||||
|
||||
Canopsis is a hypervision tool. LibreNMS can send alerts to Canopsis which are then converted to canopsis events. To configure the transport, go to:
|
||||
|
||||
Global Settings -> Alerting Settings -> Canopsis Transport.
|
||||
|
||||
You will need to fill this paramaters :
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['canopsis']['host'] = 'www.xxx.yyy.zzz';
|
||||
$config['alert']['transports']['canopsis']['port'] = '5672';
|
||||
$config['alert']['transports']['canopsis']['user'] = 'admin';
|
||||
$config['alert']['transports']['canopsis']['passwd'] = 'my_password';
|
||||
$config['alert']['transports']['canopsis']['vhost'] = 'canopsis';
|
||||
```
|
||||
|
||||
For more information about canopsis and its events, take a look here :
|
||||
http://www.canopsis.org/
|
||||
http://www.canopsis.org/wp-content/themes/canopsis/doc/sakura/user-guide/event-spec.html
|
||||
|
||||
## osTicket
|
||||
|
||||
[Using a proxy?](../Support/Configuration.md#proxy-support)
|
||||
|
||||
osTicket, open source ticket system. LibreNMS can send alerts to osTicket API which are then converted to osTicket tickets. To configure the transport, go to:
|
||||
|
||||
Global Settings -> Alerting Settings -> osTicket Transport.
|
||||
|
||||
This can also be done manually in config.php :
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['osticket']['url'] = 'http://osticket.example.com/api/http.php/tickets.json';
|
||||
$config['alert']['transports']['osticket']['token'] = '123456789';
|
||||
```
|
||||
|
||||
## Microsoft Teams
|
||||
|
||||
[Using a proxy?](../Support/Configuration.md#proxy-support)
|
||||
|
||||
Microsoft Teams. LibreNMS can send alerts to Microsoft Teams Connector API which are then posted to a specific channel. To configure the transport, go to:
|
||||
|
||||
Global Settings -> Alerting Settings -> Microsoft Teams Transport.
|
||||
|
||||
This can also be done manually in config.php :
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['msteams']['url'] = 'https://outlook.office365.com/webhook/123456789';
|
||||
```
|
||||
|
||||
## Cisco Spark
|
||||
|
||||
[Using a proxy?](../Support/Configuration.md#proxy-support)
|
||||
|
||||
|
||||
Cisco Spark. LibreNMS can send alerts to a Cisco Spark room. To make this possible you need to have a RoomID and a token.
|
||||
|
||||
For more information about Cisco Spark RoomID and token, take a look here :
|
||||
https://developer.ciscospark.com/getting-started.html
|
||||
https://developer.ciscospark.com/resource-rooms.html
|
||||
|
||||
To configure the transport, go to:
|
||||
|
||||
Global Settings -> Alerting Settings -> Cisco Spark transport.
|
||||
|
||||
This can also be done manually in config.php :
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['ciscospark']['token'] = '1234567890QWERTYUIOP';
|
||||
$config['alert']['transports']['ciscospark']['roomid'] = '1234567890QWERTYUIOP';
|
||||
$config['alert']['transports']['slack'][] = array('url' => "https://hooks.slack.com/services/A12B34CDE/F56GH78JK/L901LmNopqrSTUVw2w3XYZAB4C", 'channel' => '@john', 'username' => 'LibreNMS', 'icon_emoji' => ':ghost:');
|
||||
```
|
||||
|
||||
## SMSEagle
|
||||
@@ -444,59 +473,39 @@ $config['alert']['transports']['syslog']['syslog_port'] = 514;
|
||||
$config['alert']['transports']['syslog']['syslog_facility'] = 3;
|
||||
```
|
||||
|
||||
## Elasticsearch
|
||||
## Telegram
|
||||
|
||||
You can have LibreNMS emit alerts to an elasticsearch database. Each fault will be sent as a separate document.
|
||||
The index pattern uses strftime() formatting.
|
||||
The proxy setting uses the proxy set in config.php if true and does not if false; this allows you to use local servers.
|
||||
[Using a proxy?](../Support/Configuration.md#proxy-support)
|
||||
|
||||
> Thank you to [snis](https://github.com/snis) for these instructions.
|
||||
|
||||
1. First you must create a telegram account and add BotFather to you list. To do this click on the following url: https://telegram.me/botfather
|
||||
|
||||
2. Generate a new bot with the command "/newbot" BotFather is then asking for a username and a normal name. After that your bot is created and you get a HTTP token. (for more options for your bot type "/help")
|
||||
|
||||
3. Add your bot to telegram with the following url: `http://telegram.me/<botname>` and send some text to the bot.
|
||||
|
||||
4. Now copy your token code and go to the following page in chrome: `https://api.telegram.org/bot<tokencode>/getUpdates`
|
||||
|
||||
5. You see a json code with the message you sent to the bot. Copy the Chat id. In this example that is “-9787468”
|
||||
`"message":{"message_id":7,"from":"id":656556,"first_name":"Joo","last_name":"Doo","username":"JohnDoo"},"chat":{"id":-9787468,"title":"Telegram Group"},"date":1435216924,"text":"Hi"}}]}`
|
||||
|
||||
6. Now create a new "Telegram transport" in LibreNMS (Global Settings -> Alerting Settings -> Telegram transport).
|
||||
Click on 'Add Telegram config' and put your chat id and token into the relevant box.
|
||||
|
||||
|
||||
## VictorOps
|
||||
|
||||
[Using a proxy?](../Support/Configuration.md#proxy-support)
|
||||
|
||||
VictorOps provide a webHook url to make integration extremely simple. To get the URL required login to your VictorOps account and go to:
|
||||
|
||||
Settings -> Integrations -> REST Endpoint -> Enable Integration.
|
||||
|
||||
The URL provided will have $routing_key at the end, you need to change this to something that is unique to the system sending the alerts such as librenms. I.e:
|
||||
|
||||
`https://alert.victorops.com/integrations/generic/20132414/alert/2f974ce1-08fc-4dg8-a4f4-9aee6cf35c98/librenms`
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['elasticsearch']['es_host'] = '127.0.0.1';
|
||||
$config['alert']['transports']['elasticsearch']['es_port'] = 9200;
|
||||
$config['alert']['transports']['elasticsearch']['es_index'] = 'librenms-%Y.%m.%d';
|
||||
$config['alert']['transports']['elasticsearch']['es_proxy'] = false;
|
||||
```
|
||||
|
||||
## JIRA
|
||||
|
||||
You can have LibreNMS create issues on a Jira instance for critical and warning alerts. The Jira transport only sets summary and description fiels. Therefore your Jira project must not have any other mandatory field for the provided issuetype. The config fields that need to set are Jira URL, Jira username, Jira password, Project key, and issue type.
|
||||
Currently http authentication is used to access Jira and Jira username and password will be stored as cleartext in the LibreNMS database.
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['jira']['url'] = 'https://myjira.mysite.com';
|
||||
$config['alert']['transports']['jira']['username'] = 'myjirauser';
|
||||
$config['alert']['transports']['jira']['password'] = 'myjirapass';
|
||||
$config['alert']['transports']['jira']['prjkey'][] = 'JIRAPROJECTKEY';
|
||||
$config['alert']['transports']['jira']['issuetype'][] = 'Myissuetype';
|
||||
```
|
||||
|
||||
## Gitlab
|
||||
|
||||
LibreNMS will create issues for warning and critical level alerts however only title and description are set. Uses Personal access tokens to authenticate with Gitlab and will store the token in cleartext.
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['gitlab']['host'] = 'http://gitlab.host.tld';
|
||||
$config['alert']['transports']['gitlab']['project_id'] = '1';
|
||||
$config['alert']['transports']['gitlab']['key'] = 'AbCdEf12345';
|
||||
```
|
||||
|
||||
## Philips Hue
|
||||
|
||||
Want to spice up your noc life? LibreNMS will flash all lights connected to your philips hue bridge whenever an alert is triggered.
|
||||
|
||||
To setup, go to the you http://`your-bridge-ip`/debug/clip.html
|
||||
|
||||
- Update the "URL:" field to `/api`
|
||||
- Paste this in the "Message Body" {"devicetype":"librenms"}
|
||||
- Press the round button on your `philips Hue Bridge`
|
||||
- Click on `POST`
|
||||
- In the `Command Response` You should see output with your username. Copy this without the quotes
|
||||
|
||||
|
||||
More Info: [Philips Hue Documentation](https://www.developers.meethue.com/documentation/getting-started)
|
||||
|
||||
```php
|
||||
$config['alert']['transports']['hue']['bridge'] = 'http://bridge.example.com';
|
||||
$config['alert']['transports']['hue']['user'] = 'af89jauaf98aj34r';
|
||||
$config['alert']['transports']['hue']['duration'] = 'lselect';
|
||||
$config['alert']['transports']['victorops']['url'] = 'https://alert.victorops.com/integrations/generic/20132414/alert/2f974ce1-08fc-4dg8-a4f4-9aee6cf35c98/librenms';
|
||||
```
|
||||
|
@@ -48,6 +48,8 @@ if ($action == 'remove' || preg_match('/^remove-.*$/', $action)) {
|
||||
if (dbDelete('config', '`config_id`=?', array($config_id))) {
|
||||
if ($action == 'remove-slack') {
|
||||
dbDelete('config', "`config_name` LIKE 'alert.transports.slack.$config_id.%'");
|
||||
} elseif ($action == 'remove-discord') {
|
||||
dbDelete('config', "`config_name` LIKE 'alert.transports.discord.$config_id.%'");
|
||||
} elseif ($action == 'remove-rocket') {
|
||||
dbDelete('config', "`config_name` LIKE 'alert.transports.rocket.$config_id.%'");
|
||||
} elseif ($action == 'remove-hipchat') {
|
||||
@@ -91,6 +93,26 @@ if ($action == 'remove' || preg_match('/^remove-.*$/', $action)) {
|
||||
$message = 'Could not create config item';
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'add-discord') {
|
||||
if (empty($config_value)) {
|
||||
$message = 'No Discord url provided';
|
||||
} else {
|
||||
$config_id = dbInsert(array('config_name' => 'alert.transports.discord.', 'config_value' => $config_value, 'config_group' => $config_group, 'config_sub_group' => $config_sub_group, 'config_default' => $config_value, 'config_descr' => 'Discord Transport'), 'config');
|
||||
if ($config_id > 0) {
|
||||
dbUpdate(array('config_name' => 'alert.transports.discord.'.$config_id.'.url'), 'config', 'config_id=?', array($config_id));
|
||||
$status = 'ok';
|
||||
$message = 'Config item created';
|
||||
$extras = explode('\n', $config_extra);
|
||||
foreach ($extras as $option) {
|
||||
list($k,$v) = explode('=', $option, 2);
|
||||
if (!empty($k) || !empty($v)) {
|
||||
dbInsert(array('config_name' => 'alert.transports.discord.'.$config_id.'.'.$k, 'config_value' => $v, 'config_group' => $config_group, 'config_sub_group' => $config_sub_group, 'config_default' => $v, 'config_descr' => 'Discord Transport'), 'config');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$message = 'Could not create config item';
|
||||
}
|
||||
}
|
||||
} elseif ($action == 'add-rocket') {
|
||||
if (empty($config_value)) {
|
||||
$message = 'No Rocket.Chat url provided';
|
||||
|
@@ -79,6 +79,34 @@ $no_refresh = true;
|
||||
</div>
|
||||
<!-- End Slack Modal -->
|
||||
|
||||
<!-- Discord Modal -->
|
||||
<div class="modal fade" id="new-config-discord" role="dialog" aria-hidden="true" title="Create new config item">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<form role="form" class="new_config_form">
|
||||
<div class="form-group">
|
||||
<span class="message"></span>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="discord_value">Discord API URL</label>
|
||||
<input type="text" class="form-control validation" name="discord_value" id="discord_value" placeholder="Enter the Discord API url" required pattern="[a-zA-Z0-9]{1,5}://.*">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="discord_extra">Discord options (specify one per line key=value)</label>
|
||||
<textarea class="form-control" name="discord_extra" id="discord_extra" placeholder="Enter the config options"></textarea>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-success" id="submit-discord">Add config</button>
|
||||
<a href="#" class="btn" data-dismiss="modal">Cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Discord Modal -->
|
||||
|
||||
<!-- Rocket.Chat Modal -->
|
||||
<div class="modal fade" id="new-config-rocket" role="dialog" aria-hidden="true" title="Create new config item">
|
||||
<div class="modal-dialog">
|
||||
@@ -563,6 +591,78 @@ foreach ($slack_urls as $slack_url) {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#accordion" href="#discord_transport_expand"><i class="fa fa-caret-down"></i> Discord transport</a> <button name="test-alert" id="test-alert" type="button" data-transport="discord" class="btn btn-primary btn-xs pull-right">Test transport</button>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="discord_transport_expand" class="panel-collapse collapse">
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<div class="col-sm-8">
|
||||
<button class="btn btn-success btn-xs" type="button" name="new_config" id="new_config_item" data-toggle="modal" data-target="#new-config-discord">Add Discord URL</button>
|
||||
</div>
|
||||
</div>';
|
||||
$discord_urls = get_config_like_name('alert.transports.discord.%.url');
|
||||
foreach ($discord_urls as $discord_url) {
|
||||
unset($upd_discord_extra);
|
||||
$new_discord_extra = array();
|
||||
$discord_extras = get_config_like_name('alert.transports.discord.'.$discord_url['config_id'].'.%');
|
||||
foreach ($discord_extras as $extra) {
|
||||
$split_extra = explode('.', $extra['config_name']);
|
||||
if ($split_extra[4] != 'url') {
|
||||
$new_discord_extra[] = $split_extra[4].'='.$extra['config_value'];
|
||||
}
|
||||
}
|
||||
|
||||
$upd_discord_extra = implode(PHP_EOL, $new_discord_extra);
|
||||
echo '<div id="'.$discord_url['config_id'].'">
|
||||
<div class="form-group has-feedback">
|
||||
<label for="discord_url" class="col-sm-4 control-label">Discord URL </label>
|
||||
<div class="col-sm-4">
|
||||
<input id="discord_url" class="form-control" type="text" name="global-config-input" value="'.$discord_url['config_value'].'" data-config_id="'.$discord_url['config_id'].'">
|
||||
<span class="form-control-feedback">
|
||||
<i class="fa" aria-hidden="true"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<button type="button" class="btn btn-danger del-discord-config" name="del-discord-call" data-config_id="'.$discord_url['config_id'].'"><i class="fa fa-minus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group has-feedback">
|
||||
<div class="col-sm-offset-4 col-sm-4">
|
||||
<textarea class="form-control" name="global-config-textarea" id="upd_discord_extra" placeholder="Enter the config options" data-config_id="'.$discord_url['config_id'].'" data-type="discord">'.$upd_discord_extra.'</textarea>
|
||||
<span class="form-control-feedback">
|
||||
<i class="fa" aria-hidden="true"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
}//end foreach
|
||||
|
||||
echo '<div class="hide" id="discord_url_template">
|
||||
<div class="form-group has-feedback">
|
||||
<label for="discord_url" class="col-sm-4 control-label api-method">Discord URL </label>
|
||||
<div class="col-sm-4">
|
||||
<input id="discord_url" class="form-control" type="text" name="global-config-input" value="" data-config_id="">
|
||||
<span class="form-control-feedback">
|
||||
<i class="fa" aria-hidden="true"></i>
|
||||
</span>
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<button type="button" class="btn btn-danger del-discord-config" name="del-discord-call" data-config_id=""><i class="fa fa-minus"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group has-feedback">
|
||||
<div class="col-sm-offset-4 col-sm-4">
|
||||
<textarea class="form-control" name="global-config-textarea" id="upd_discord_extra" placeholder="Enter the config options" data-config_id="" data-type="discord"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
@@ -1720,6 +1820,42 @@ echo '
|
||||
});
|
||||
});// End Add Slack config
|
||||
|
||||
// Add Discord config
|
||||
discordIndex = 0;
|
||||
$("button#submit-discord").click(function(){
|
||||
var config_value = $('#discord_value').val();
|
||||
var config_extra = $('#discord_extra').val();
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "ajax_form.php",
|
||||
data: {type: "config-item", action: 'add-discord', config_group: "alerting", config_sub_group: "transports", config_extra: config_extra, config_value: config_value},
|
||||
dataType: "json",
|
||||
success: function(data){
|
||||
if (data.status == 'ok') {
|
||||
discordIndex++;
|
||||
var $template = $('#discord_url_template'),
|
||||
$clone = $template
|
||||
.clone()
|
||||
.removeClass('hide')
|
||||
.attr('id',data.config_id)
|
||||
.attr('discord-url-index', discordIndex)
|
||||
.insertBefore($template);
|
||||
$clone.find('[name="global-config-input"]').attr('data-config_id',data.config_id);
|
||||
$clone.find('[name="del-discord-call"]').attr('data-config_id',data.config_id);
|
||||
$clone.find('[name="global-config-input"]').attr('value', config_value);
|
||||
$clone.find('[name="global-config-textarea"]').val(config_extra);
|
||||
$clone.find('[name="global-config-textarea"]').attr('data-config_id',data.config_id);
|
||||
$("#new-config-discord").modal('hide');
|
||||
} else {
|
||||
$("#message").html('<div class="alert alert-info">' + data.message + '</div>');
|
||||
}
|
||||
},
|
||||
error: function(){
|
||||
$("#message").html('<div class="alert alert-danger">Error creating config item</div>');
|
||||
}
|
||||
});
|
||||
});// End Add Discord config
|
||||
|
||||
// Add RocketChat config
|
||||
rocketIndex = 0;
|
||||
$("button#submit-rocket").click(function(){
|
||||
@@ -1949,6 +2085,27 @@ echo '
|
||||
});
|
||||
});// End delete slack config
|
||||
|
||||
// Delete discord config
|
||||
$(document).on('click', 'button[name="del-discord-call"]', function(event) {
|
||||
var config_id = $(this).data('config_id');
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'ajax_form.php',
|
||||
data: {type: "config-item", action: 'remove-discord', config_id: config_id},
|
||||
dataType: "json",
|
||||
success: function (data) {
|
||||
if (data.status == 'ok') {
|
||||
$("#"+config_id).remove();
|
||||
} else {
|
||||
$("#message").html('<div class="alert alert-info">' + data.message + '</div>');
|
||||
}
|
||||
},
|
||||
error: function () {
|
||||
$("#message").html('<div class="alert alert-danger">An error occurred.</div>');
|
||||
}
|
||||
});
|
||||
});// End delete discord config
|
||||
|
||||
// Delete Rocket.Chat config
|
||||
$(document).on('click', 'button[name="del-rocket-call"]', function(event) {
|
||||
var config_id = $(this).data('config_id');
|
||||
@@ -2122,3 +2279,4 @@ echo '
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
|
Reference in New Issue
Block a user