PagerDuty Plugin

This DevJam I intend to pickup my initial work from 2017 on the initial PagerDuty integration and make it work as OIA plugin.

This will likely involve extending the OIA and may require a dive into notifd.

Packaging the integration as an OIA plugin will make it easier to add integration with other providers such as Opsgenie and VictorOps in the future.

4 Likes

I started this effort by trying to add support for NotificationStrategy plugins in the OIA. Working with the NotificationStrategy interface as it is currently defined is challenging because of the arguments lack structure (no real types) and there is lack of context. While it may be well suited for command line extensions, it doesn’t offer a nice API to work with.

Instead of going this route, I opted to integrate directly with alarms and leverage the existing AlarmLifecycleListener interface - this gives us a feed of all the alarms and their changes.

Since the plugin is not integrating with notifd, we cannot use the existing facilities for filtering events (i.e. what should be forwarded). As a quick solution, I added support for using JEXL expression to filter the alarms. This gives us flexibility, but can get difficult to get the expressions just right.

The plugin is now functional with OpenNMS Horizon 26.1.3 or greater and can be found here:

1 Like

In order to demonstrate the PD plugin in a fun way for DevJam I developed a Minecraft plugin that sends events when users enter/leave pre-defined zones.

These events trigger alarms which are used by a series of Drools rules to track how many players are in a given zone. If the number of players in a given zone exceed the capacity as defined in the rules, another alarm is raised.

The Minecraft plugin can be found here:

Drools rules are defined here: https://github.com/j-white/mc2nms/blob/52740ec9da1656dccefaf8a18da39de3ea843fb5/etc/minecraft.drl

Other related OpenNMS configuration/assets: https://github.com/j-white/mc2nms/tree/master/etc

1 Like