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 OpenNMS 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 OpenNMS 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 OpenNMS
This integration uses the OpenNMS webhook notification strategy
WebhookNotificationStrategy, which requires OpenNMS Horizon 36.0.3 or later. Earlier versions do not have this strategy, so upgrade first. Below, $OPENNMS_HOME is the OpenNMS installation directory, /opt/opennms in the official container image. The OpenNMS server must be able to reach the Flashduty push URL.
1
Add the Flashduty notification command
Edit Notes:
$OPENNMS_HOME/etc/notificationCommands.xml, add the following command before </notification-commands>, and replace the address in -url with the push URL you copied:- Every
${name}in the body needs an<argument>with the matching name; a missing one is replaced with an empty string.notice_idis the field Flashduty uses to identify the alert, so do not remove it - If the push URL contains
&(for example, because you appended other query parameters), write it as&in the XML
flashduty command does not appear in the destination path wizard in the next step. On the OpenNMS server, run $OPENNMS_HOME/bin/send-event.pl -p 'daemonName Notifd' uei.opennms.org/internal/reloadDaemonConfig. The official container image has no Perl, so send the same event through the REST API instead (replace <OpenNMS> with the OpenNMS address and enter the admin password when prompted):2
Create the receiving user and destination path
OpenNMS runs the notification command once for each target user in a destination path. To push each notice only once, create a dedicated user for Flashduty:
- Select Administration → Configure OpenNMS, open Configure Users under Configure Users, Groups and On-Call Roles, and add the user
flashduty. Do not give this user a duty schedule - Go back to Configure OpenNMS, select Configure Notifications → Configure Destination Paths under Event Management, and click New Path
- Name it
Flashduty, click Edit, select onlyflashdutyunder Send to Selected Users, and click Next Step - Select the
flashdutycommand, set Auto Notify to On, click Next Step, and then click Finish
3
Choose the event notifications to push
Under Configure Notifications → Configure Event Notifications, edit each event notification you want to push to Flashduty and change its destination path to
Flashduty. To keep email as well, add a second notification for the same event that uses the Flashduty path. We recommend pushing these notifications, which have recovery events:Do not use the
Flashduty path for informational notifications such as nodeAdded and interfaceDeleted, or for threshold Rearmed notifications. They have no recovery event, so each one would create an alert that never closes on its own.4
(Optional) Push the event severity
OpenNMS does not pass the event severity to notification commands on its own. To tell alert severities apart in Flashduty, edit OpenNMS replaces
$OPENNMS_HOME/etc/notifications.xml and add the following line to every <notification> pushed to Flashduty, before </notification>:%severity% with the severity of the triggering event (Critical, Major, Minor, and so on). Without this line, every alert in Flashduty has Critical severity.5
Turn on notifications
Notifications are off in a new OpenNMS installation. Select Administration → Configure OpenNMS, set Notification Status under Event Management to On, and click Update. The bell icon in the top menu bar turns green when notifications are on.
6
Verify the lifecycle
Make a service on a monitored node stop responding (for example, stop the HTTP service on the node), wait for OpenNMS to detect it on its next poll, and confirm that Flashduty receives an active alert. Then restore the service and confirm that the alert closes.You can also send events by hand on the OpenNMS server. Replace the node ID and IP address with the values of a monitored node:The official container image has no Perl to run OpenNMS has no button to test a notification command on its own.
send-event.pl; send the same events through the REST API instead:Alert Key
Flashduty uses the OpenNMS notice ID
notice_id (${noticeid}) as the Alert Key. The notice ID stays the same when an escalation step resends the notice and when OpenNMS sends the resolution notice after a recovery event auto-acknowledges it, so all of these land on the same alert.
When the same node or service goes down again, OpenNMS creates a new notice and Flashduty creates a new alert. When one event matches several event notifications pushed to Flashduty, each notice creates its own alert.
Notice IDs are unique only within one OpenNMS instance. Use a separate integration for each OpenNMS instance instead of pushing several instances to the same push URL.
Flashduty rejects a request that lacks notice_id, and OpenNMS logs the failed push in notifd.log.
Alert lifecycle
OpenNMS configures auto-acknowledgement (
auto-acknowledge) for outage events in notifd-configuration.xml: when the recovery event arrives, OpenNMS acknowledges the matching outage notice and sends the original notice again to its original recipients, with RESOLVED: in front of the subject and text. Flashduty checks whether the subject starts with RESOLVED::
The default auto-acknowledgements are
nodeUp→nodeDown, interfaceUp→interfaceDown, nodeRegainedService→nodeLostService, serviceResponsive→serviceUnresponsive, and wideSpreadOutageResolved→wideSpreadOutage.
To push other notices that have no auto-acknowledgement (for example, threshold alerts), add the following line inside <notifd-configuration> in notifd-configuration.xml, before all <auto-acknowledge> elements:
Severity
Severity comes from
severity in the request, which is the OpenNMS event severity that %severity% resolves to in the optional step:
In a resolution notice,
severity is the numeric severity id OpenNMS stores (for example 5 for Minor and 6 for Major). Flashduty converts ids 1–7 back to severity names, so the recovery event keeps the severity the alert was triggered with.
Alert content
- Title: the notice subject
subjectwithout theRESOLVED:prefix;OpenNMS notice #<notice ID>when the subject is empty - Description: the notice text
messagewithout theRESOLVED:prefix - Labels:
notice_id,event_id,event_uei,node_id,interface,service,severity(the severity name; the numeric id in a resolution notice is converted to its name). Labels with empty values are not added
Troubleshooting
The log messages below are in
$OPENNMS_HOME/logs/notifd.log.
- Nothing is pushed: confirm that the notification bell in the top menu bar is green, and that the event notification is On and uses the
Flashdutydestination path - The log says
org.opennms.netmgt.notifd.WebhookNotificationStrategycannot be loaded: OpenNMS is older than Horizon 36.0.3 - The log shows
the rendered -body is not valid JSON: the-bodytemplate was changed. Copy the command above again - The log shows
Webhook returned status 4xx: confirm that-urlis the full push URL, includingintegration_key - The log shows
I/O problem posting to webhook: the OpenNMS server cannot connect to the push URL within 3 seconds. Check DNS, firewalls, and proxies. To use the system proxy, add an<argument>whose<switch>is-useSystemProxyand whose<substitution>istrue - The same notice is pushed several times: the destination path targets a group or several users. Select only the
flashdutyuser - The alert does not recover: confirm that the recovery event is in the auto-acknowledge list, that
resolution-prefixis stillRESOLVED:, and that Auto Notify on the destination path is On