# LibreNMS

[<mark style="color:blue;">LibreNMS</mark>](https://librenms.org/) is an auto-discovering PHP/MySQL-based network monitoring system.

Route detailed monitoring alerts from LibreNMS to the right users in Squadcast.

### How to integrate LibreNMS with Squadcast

### In Squadcast: Using LibreNMS as an Alert Source

1. Navigate to **Services** -> **Service Overview** -> select or search for your Service. Expand the accordion -> In the Alert Sources section, click **Add**.

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-4fbd74e7ca0b30173c47a1d58ed6a0804a0465aa%2FAlert_Sources.png?alt=media\&token=aaca6610-9d18-4dd4-9cf5-320042f326f1)

2\. Select **LibreNMS**. Copy the displayed **Webhook URL** to [configure](#in-librenms-add-a-squadcast-webhook) it within **LibreNMS**. Finish by clicking **Add Alert Source** -> **Done.**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-03922e6773551c019d46276a01f5aec6d1c96c77%2FLibreNMS.png?alt=media)

{% hint style="warning" %}
**Important:**

When an alert source turns Active, it’ll show up under Configured Alert Sources, you can either generate a test alert from the integration or wait for a real-time alert to be generated by the Alert Source. An Alert Source is active if there is a recorded incident via that Alert Source for the Service.
{% endhint %}

### In LibreNMS: Add a Squadcast Webhook

**(1)** From the home page, click on the **Alerts** tab on the top

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-a8c6c68e6e1d0ca0b5cefbe6b806dbc5d57c5511%2Flibrenms_2.png?alt=media)

**(2)** Select **Alert Transports**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-a48f4c607a68492bc86d251149d1d51eb00c33df%2Flibrenms_3.png?alt=media)

**(3)** Click on **Create alert transport**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-e5c72f28a5ec0855ed7e8ffeb7e810e458286317%2Flibrenms_4.png?alt=media)

**(4)** Next:

* Give the Alert Transport a **Name**
* Choose **Transport type** as `Api`
* **Default alert** is toggled to `ON`
* Choose **API Method** as `POST`
* In the placeholder for **API URL**, paste the copied Webhook from Squadcast
* In **Options**, add the template below **as is**:

```json
device_id={{ $device_id }}
hostname= {{ $hostname }}
sysName={{ $sysName }}
sysDescr={{ $sysDescr }}
sysContact={{ $sysContact }}
os={{ $os }}
type={{ $type }}
ip={{ $ip }}
hardware={{ $hardware }}
version={{ $version }}
features={{ $features }}
serial={{ $serial }}
location={{ $location }}
uptime={{ $uptime }}
uptime_short={{ $uptime_short }}
uptime_long={{ $uptime_long }}
description={{ $description }}
notes={{ $notes }}
alert_notes={{ $alert_notes }}
ping_timestamp={{ $ping_timestamp }}
ping_loss={{ $ping_loss }}
ping_min={{ $ping_min }}
ping_max={{ $ping_max }}
ping_avg={{ $ping_avg }}
title={{ $title }}
elapsed={{ $elapsed }}
builder={{ $builder }}
id={{ $id }}
uid={{ $uid }}
state={{ $state }}
severity={{ $severity }}
rule={{ $rule }}
name={{ $name }} 
proc={{ $proc }} 
timestamp={{ $timestamp }} 
transport={{ $transport }} 
transport_name={{ $transport_name }}
```

* Click on **Save Transport**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-11f71633b1b9727cc561ca96e4715dbe832fdec0%2Flibrenms_5.png?alt=media)

**(5)** Once your Alert Transport has been created, click on the **Alerts** tab on the top and select **Alert Rules**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-f26926199cac291821bdf83f3b24ef62d6a90f38%2Flibrenms_6.png?alt=media)

**(6)** You can either **Add alert rule** or modify an existing one. Choose the **Alert Rule** for which Squadcast Webhook should be triggered.

Here, in **Transports**:

* Select the **Squadcast Webhook** that was previously created
* Enable the toggle for **Recovery Alerts** to `ON`
* Click on **Save Rule**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-a9a3c51b52ecc33ecd924beed2ab9ac7c1712e9a%2Flibrenms_7.png?alt=media)

**(7)** Back in the **Alert Rule** dashboard, you can verify the rules for which **Squadcast Webhook** is added as a **Transport**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-b8fd5a2f0f5516dada23d82d45fa89c20f2ac915%2Flibrenms_8.png?alt=media)

That is it, your integration with LibreNMS is complete and you are good to go!

Now, every time there is an alert in LibreNMS, the alert will be sent to Squadcast and an incident will be triggered, notifying the right people. Similarly, when the alert gets resolved in LibreNMS, the corresponding incident will get **auto-resolved** in Squadcast as well.

*Have any questions?* [*Ask the community*](https://community.squadcast.com/view/home)*.*
