In Flashduty On-call
You can get the integration push URL in either of the following ways.
Use a dedicated integration
- In the Flashduty console, select Channel and open a channel
- Select Configuration → Integrations → Private integration, then click Add an integration
- Select LibreNMS and click Save
- Open the new integration card and copy the Push URL
Use a shared integration
- In the Flashduty console, select Integration Center → Alert Events
- Select LibreNMS and enter an integration name
- Configure the default route and select a channel. You can add more rules under Routes after creation
- Click Save and copy the generated Push URL
Configure LibreNMS
The steps below need LibreNMS 25.7.0 or later: the body template escapes text fields with the
json_encode filter, which is available from 25.7.0.
1
Create the alert transport
Go to Alerts → Alert Transports, click Create alert transport, and fill in the form as follows:Do not add quotes around the fields that use
Body template:
|json_encode: the filter already outputs a quoted, escaped JSON string, so quotes or line breaks in a rule name or alert message cannot break the JSON.Leave the other fields at their defaults and click Save.2
Attach the transport to alert rules
From LibreNMS 26.4.0, alert rules pick their notification transports through an Operation. Earlier versions select Transports directly on the rule. Follow the steps for your version:LibreNMS 26.4.0 and later
- Go to Alerts → Operations and create an Operation, or edit the Operation the rule already uses
- Add the transport created above to a segment. For a new Operation, set Steps from to
1, Steps to to1, and Start (s) to0to send one notification as soon as the rule matches - Go to Alerts → Alert Rules, edit the rule, and select that Operation under Operation
3
Verify the lifecycle
In the Alerts → Alert Transports list, click the test button next to the transport (the yellow check mark icon, tooltip Test transport) and confirm that LibreNMS reports a successful test. The test uses fixed LibreNMS test data (
alert_id is 000); Flashduty returns success and creates no alert.Then make a rule really trigger (for example, make a monitored device unreachable so that the Devices up/down rule alerts) and confirm that Flashduty receives an active alert. Bring the device back and confirm that the alert closes. LibreNMS checks alert rules after each poll, so alerts and recoveries usually arrive within one polling interval (5 minutes by default).Alert Key
Flashduty uses
alert_id as the Alert Key. alert_id is the row ID in the LibreNMS alerts table, which holds exactly one row per device and alert rule, and every trigger, change, and recovery notification carries the same value. The LibreNMS PagerDuty transport uses it as its dedup key too. So notifications for the same rule on the same device land on one alert, and a new trigger after recovery opens a new alert.
Changes to the severity, rule name, host name, or alert message do not change the Alert Key. alert_id is unique only within one LibreNMS instance: use a separate Flashduty integration for each LibreNMS instance.
Flashduty rejects requests without alert_id or state.
Alert lifecycle
Flashduty handles notifications by the
state field:
Rules that use an Operation (LibreNMS 26.4.0 and later) send only trigger, acknowledgement, and recovery notifications, never
state 3, 4, or 5. Those three are sent only when the rule selects Transports directly (25.7.0 to 26.3.x).
When Acknowledgement alerts is on for a rule, LibreNMS sends a notification with state 2 when the alert is acknowledged. Acknowledgements neither open nor close a Flashduty alert, and ignored notifications get a success response.
Severity
The severity comes from the Severity of the alert rule:
Recovery notifications carry the same rule severity, and the recovery event keeps it.
Alert content
- Title:
<rule name> on <host name>. When the rule name is empty,LibreNMS rule <rule_id>is used instead - Description: the alert message
msgrendered from the LibreNMS alert template. The default template includes the title, severity, time, and faulty items - Labels:
check(rule name),resourceandhost(host name),alert_id,rule_id,device_id,sys_name,os,location,severity(raw rule severity),state(alert,worse,better,changed, orrecovered)
Troubleshooting
- The test fails with
Transport delivery failed with 401andintegration_key is required: putintegration_keyin Options, not in the API URL - The test fails with
Transport delivery failed with 400: if the response shows{{ $name|json_encode }}unrendered, LibreNMS is older than 25.7.0 and does not know thejson_encodefilter; upgrade it. Otherwise make sure the fields with|json_encodehave no extra quotes and that Send as form is unchecked - No alert is sent: on 26.4.0 and later, make sure the rule uses an Operation that contains the transport; on earlier versions, make sure the rule’s Transports include it. Check the send result on the device’s Alerts page or in the Event Log
- The alert does not recover: make sure Recovery alerts is on for the rule