LibreNMS Integration Guide
LibreNMS is a popular open-source application that monitors systems, networks and infrastructure.
What can Zenduty do for LibreNMS users?
With LibreNMS's Integration, Zenduty sends new LibreNMS alerts to the right team and notifies them based on on-call schedules via email, text messages(SMS), phone calls(Voice), Slack, Microsoft Teams and iOS & Android push notifications, and escalates alerts until the alert is acknowledged or closed when specific conditions that you define are triggered in your ELK Stack environment. Zenduty provides your NOC, SRE and application engineers with detailed context around the LibreNMS alert along with playbooks and a complete incident command framework to triage, remediate and resolve incidents with speed.
Whenever LibreNMS triggers an alert when specific conditions that you define are triggered within LibreNMS, Zenduty will then create an incident. When that condition goes back to normal levels, Zenduty will auto-resolve the incident.
You can also use Alert Rules to custom route specific LibreNMS alerts to specific users, teams or escalation policies, write suppression rules, auto add notes, responders and incident tasks.
To integrate LibreNMS with Zenduty, complete the following steps:
In Zenduty:
-
To add a new LibreNMS integration, go to Teams on Zenduty and click on the team you want to add the integration to.
-
Next, go to Services and click on the relevant Service.
-
Go to Integrations and then Add New Integration. Give it a name and select the application LibreNMS from the dropdown menu.
-
Go to Configure under your Integrations and copy the Webhook URL generated.
In LibreNMS:
-
Sign into LibreNMS.
-
Go to Alerts->Alert Templates. You can create a new template or updated the existing one. In the Template section, paste the below snippet.
{ "title": "{{ $alert->title }}", "Severity": "{{ $alert->severity }}", @if ($alert->state == 0)"Time elapsed": "{{ $alert->elapsed }}", @endif "Timestamp": "{{ $alert->timestamp }}", "Unique-ID": "{{ $alert->uid }}", "Rule": @if ($alert->name) "{{ $alert->name }}" @else "{{ $alert->rule }}" @endif, @if ($alert->faults) "Faults": { @foreach ($alert->faults as $key => $value) "#{{ $key }}": "{{ $value['string'] }}," @endforeach} @endif }
- If you have created new templatet then select all the alerts for which you want send alerts to the Zenduty
-
Go to Alerts->Alert Transports. Click on Create alert transport.
-
Provide a Transport name. From the Transport type dropdown, select API. Choose the API Method as POST. In the API URL input box, paste the Webhook URL that you copied in Step 4.
-
In the Body input box, paste the code below:
{ "hostname": "{{ $hostname }}", "sysName": "{{ $sysName }}", "id": "{{ $id }}", "uid": "{{ $uid }}", "sysDescr": "{{ $sysDescr }}", "os": "{{ $os }}", "type": "{{ $type }}", "ip": "{{ $ip }}", "hardware": "{{ $hardware }}", "version": "{{ $version }}", "uptime": "{{ $uptime }}", "uptime_short": "{{ $uptime_short }}", "timestamp": "{{ $timestamp }}", "description": "{{ $description }}", "title": "{{ $title }}", "msg": {{ msg }}, "state": "{{ $state }}" }
-
Leave the rest of the inputs as blank and click on Save Transport to save your transport.
-
Navigate to Alerts->Alert Rules. Click on Create new alert rule. Give your rule a name and choose the alert logic. Set the Severity to Critical. Set Recovery alerts as ON.
-
Choose your devices on which you'd like to apply the alerts.
-
In the Transports section, select the Transport you created in Steps 5 to 8 above. Click on Save Rule.
-
Your Zenduty to LibreNMS integration is now complete!