LibreNMS Integration
LibreNMS is an auto discovering PHP/MySQL/SNMP based network monitoring which includes support for a wide range of network hardware and operating systems including Cisco, Linux, Juniper, Foundry, and many more.
What does Opsgenie offer to LibreNMS users?
Using Opsgenie LibreNMS integration, LibreNMS forwards alerts to Opsgenie with detailed information. Opsgenie acts as a dispatcher for LibreNMS alerts, determines the right people to notify based on on-call schedules– notifies via email, text messages (SMS), phone calls and iOS & Android push notifications, and escalates alerts until the alert is acknowledged or closed.
Functionality of the integration
- When an alert is triggered in LibreNMS, the alert is created in Opsgenie.
- When the alert is acknowledged in LibreNMS, the alert is acknowledged in Opsgenie.
- When the alert is closed in LibreNMS, it closes the alert in Opsgenie.
- If Send Alert Updates Back to LibreNMS is enabled, actions for LibreNMS are executed in LibreNMS when the chosen action is executed in Opsgenie for alerts which are created by the LibreNMS integration. (Optional)
Add LibreNMS Integration in Opsgenie
- Please create an Opsgenie account if you haven't done so already.
- Go to Opsgenie LibreNMS Integration page.
For Free and Essentials plans, you can only add the integrations from the Team Dashboards, please use the alternative instructions given below to add this integration.
- Specify who is notified of LibreNMS alerts using the Teams field. Auto-complete suggestions are provided as you type.
An alternative for Step 2) and Step 3) is to add the integration from the Team Dashboard of the team which will own the integration. To add an integration directly to a team, navigate to the Team Dashboard and open Integrations tab. Click Add Integration and select the integration that you would like to add.
- Copy the Webhook URL.
- Click Save Integration.
Configuration in LibreNMS
- Open Global Settings from the gear icon on the top menu in LibreNMS.
- Select the Alerting Settings tab.
- Find "Opsgenie" from the list and expand it by clicking on the arrow.
- Paste the Webhook URL into the "Opsgenie URL" field.
Integration via Marid (Optional)
Use Opsgenie's LibreNMS package to acknowledge or unmute alerts in LibreNMS. This enables deployment of custom scripts / modification of the ones provided and the ability to execute customized actions on LibreNMS alerts.
Download and install LibreNMS package
For Red Hat Based Distributions
- Download Opsgenie LibreNMS (Linux RPM)
- Run the following command :
rpm -i opsgenie-librenms-<your_version>.rpm
During upgrades, rpm package does not overwrite existing configurations. It saves the new default configuration file as opsgenie-integration.conf.rpmnew. Find more information about rpm upgrade config file handling from here.
For Debian Based Distributions
- Download Opsgenie LibreNMS (Linux DEB)
- Run the following command :
dpkg -i opsgenie-librenms-<your_version>.deb
To set JAVA_HOME environment variable, refer to Setting JAVA_HOME for more information.
To enable Ruby scripting, download JRuby Complete jar file and put this jar file in lib directory (/var/lib/opsgenie/marid On Linux, MARID_HOME/lib on Windows systems.).
Configuring LibreNMS Integration for Marid
If you are using Opsgenie Edge Connector instead of Marid, you can find the integration specific script and its sample config from here. For more information about OEC, please refer OEC Integration documentation
- Configurations regarding LibreNMS can be done either via integration page or Marid configuration file opsgenie-integration.conf. Configuration in integration page precedes the configuration file.
- To start Marid, run the following command:
sudo /etc/init.d/marid start
- To stop Marid, run the following command:
sudo /etc/init.d/marid stop
To execute actions in LibreNMS, Marid gets the configuration parameters from <MARID_HOME>/conf/marid.conf file.
Parameter | Description | Mandatory to Fill |
---|---|---|
apiKey | Copy the API key from the LibreNMS integration you've created above | Yes |
librenms.url | Your LibreNMS server URL | Yes |
librenms.apiToken | Your LibreNMS server API token | Yes |
According to the action that is executed in LibreNMS, the script to be run is set here. Opsgenie's script is set by default; change the following configuration to run custom script if desired.
Action Mappings | |
---|---|
mappedActions.ackAlert.script | librenmsActionExecutor.groovy |
mappedActions.unmuteAlert.script | librenmsActionExecutor.groovy |
Sample Parameters Sent to Marid
{
"type": "libreNMS",
"alertId": "f3b3475f-3859-4bd1-b472-ab339ea1e61d",
"customerId": "4a644594-240d-4a51-ab88-0171ed29c0ce",
"action": "Acknowledge",
"mappedActionV2": {
"name": "ackAlert",
"extraField": ""
},
"integrationId": "1334572c-f412-428c-9ab1-607f8313fba3",
"integrationName": "LibreNMS",
"integrationType": "LibreNMS",
"sendViaMarid": true,
"alertFlowContext": {
"requestId": "9eb36837-e601-12da-92ba-8fe3224230ad",
"traceId": "9eb36837-e601-12da-92ba-8fe3224230ad",
"content": {
"alertId": "f3b3475f-3859-4bd1-b472-ab339ea1e61d"
}
},
"url": "",
"apiToken": "",
"rule": "%macros.device_up = \"1\" && %processors.processor_usage >= \"1\""
}
Updated almost 5 years ago