Learn how to configure your profile, get notifications from Opsgenie and view on-call schedules.
Learn how to configure your profile, get notifications from Opsgenie and view on-call schedules.
Start building your teams, integrate your tools and create on-call schedules.
Advanced Opsgenie account settings and other reference information
Learn how to receive and manage alerts, create policies and encrypt alert data.
Learn all the ways to create an integration, use Opsgenie's integration framework and check system health with Heartbeats.
Notify the right users, investigate potential causes and take preventive actions to avoid future incidents.
Manage your services, create service relationships, view the service status and report problems.
Learn all the ways to set up Opsgenie actions, create channels and execute actions.
Learn how to use Opsgenie's integration server to connect your internal and external systems.
Analyze Opsgenie activity with global and team reports.
Learn all the ways to log in Opsgenie, set password policies and administer user accounts.
This integration is deprecated.
This means that you won’t be able to add new OpenNMS integrations to your Opsgenie account. Existing OpenNMS integrations will continue to work for the time being. However "Scenario 2: Rich Alert Integration" will be unavailable.
What does Opsgenie offer OpenNMS users?
Opsgenie enables OpenNMS users to receive OpenNMS events (referred to as alerts in Opsgenie) through email, SMS, phone call, and iPhone/Android push notifications and works with OpenNMS events from mobile phones. Opsgenie alerts contain not only the event but also supporting information such as managed object details, performance charts, etc. enabling users to make better decisions when notified.
Opsgenie provides various integration tools and APIs to integrate monitoring tools with Opsgenie so that users are notified when something important occurs in their environment. Use the following integration scenarios and packages provided by Opsgenie as a starting point to integrate OpenNMS with Opsgenie alerting system.
Scenario 1: Email Integration
OpenNMS has the capability to send emails to notify users for specified events. Using Opsgenie’s email integration capabilities, Opsgenie notifies users via SMS, iPhone or Android push notifications, or phone calls. Instructions below describe how to configure OpenNMS and Opsgenie to send push notifications to iPhone/Android apps using Opsgenie email integration for OpenNMS authentication failed events as an example.
Add OpenNMS Email method in Opsgenie
Set up Opsgenie email rules which create alerts from emails sent from OpenNMS. When your account is created Opsgenie provides a default email address and a default email rule for you. Modify your email address and rules in the Settings page. For this setup the default rules are used, which creates alerts for every incoming mail. Find more information on email integration here.
Add an Opsgenie Email Integration.
Copy the email address from the Opsgenie Email Integration.
Click Save Integration.
Add Opsgenie in OpenNMS
Create a user account for Opsgenie integration in OpenNMS web UI. Click the Admin link in the menu bar.
Go to "Configure Users, Groups and On-Call Roles".
Click Configure Users.
Click Add New User, type "OpsGenie" in the username field and provide a password in the form.
Paste the email copied previously to the Email field in the OpenNMS user form.
To receive a notification from OpenNMS, your user or a group that your user is in needs to be a part of a destination path.
Go to the "Admin" page.
Click Configure Notifications in the "Operations" section, then "Configure Destination Paths," then click New Path.
Give it a name, like "OpsGenieEmailPath", then click Edit.
Add "OpsGenie" user by selecting it, then click Next >>>.
On the next page, leave the defaults ("javaEmail" and "on") and click Next >>> again.
Click Finish and you should see your new destination path in the "Existing Paths" section.
Next, associate OpenNMS events with the new destination path.
Go to the "Admin" page,
Click Configure Notifications in the "Operations" section, then Configure Event Notifications.
Click Add New Event Notification at the top of the "Event Notifications" page.
Select "OpenNMS-defined internal event: an authentication failure has occurred in WebUI" event for the time being to test the setup easily. This configuration can be changed later if desired.
5. Click Next >>>.
6. Click Skip results validation >>> on the next page.
Finally, configure the information used to send the notification. Fill in the following values:
Name: Authentication Failed
Choose A Path: OpsGenieEmailPath
Text Message: The OpenNMS Web UI had a failed login attempt, by user '%parm[user]%', from IP address %parm[ip]%
Short Message: Authentication failed by user '%parm[user]%'
Email Subject: Authentication failed by user '%parm[user]%'
7. Click Finish. Now notification events appear in the list, but are disabled.
8. Set the radio button to On to enable it. In the main OpenNMS Admin page, there is a radio selector labeled, "Notification Status." Change it to On.
9. Click Update.
10. Configure the mail server in $OPENNMS_HOME/etc/javamail-configuration.properties file and restart OpenNMS server.
Now the setup is completed to create an OpenNMS event and receive an Opsgenie push notification.
Logout from OpenNMS web UI and try to login with an invalid account. A push notification is sent, if not delivered, take a look at "$OPENNMS_HOME/logs/daemon/notifd.log" and see if an error message occurs. If no problem exists, look at Opsgenie alerts page and check whether the new alert exists in the alert list.
Access more information on OpenNMS notifications in the following pages:
Scenario 2: Rich Alert Integration
OpenNMS notification system allows executing arbitrary external programs, which opens endless possibilities to integrate with Opsgenie alerting system through Opsgenie client tools like Lamp, Marid, etc. Opsgenie provides a downloadable OpenNMS integration package which shows rich alerting capabilities of our system. Integration files include example groovy script that forwards node events, script also retrieves most recent node outages to the alert from OpenNMS and attaches to the alert to make this information available to the recipients.
Download OpsGenie OpenNMS Integration files that include:
Lamp - Opsgenie command line utility to create alerts
OpenNMS Integration scripts
Unzip OpenNMS Integration
OpenNMS Integration Files contains a customized version of Lamp , install this version.
Install lamp by referring to Lamp Documentation - Installation steps. Do not download lamp again.
Make sure the OpenNMS shell scripts have correct LAMP_HOME, the lamp installation directory.
Create an OpsGenie API Integration, copy the integration apiKey, put into the opsgenie-integration/conf/opsgenie-integration.conf file.
Verify Lamp is working: Create a test alert, using the lamp utility from the command line, make sure your alert is visible on Opsgenie dashboard. Please refer to Lamp Documentation for more information.
Groovy script configuration: Instead of implementing all logic in the shell script, the integration package provides a script (ogCreateAlert.groovy) written in groovy - a powerful Java-based scripting language- which can be executed by Lamp. Briefly, the script creates an Opsgenie alert, retrieves node outages through OpenNMS rest API, creates an HTML file showing the outages and attaches it to the alert.
RECIPIENTS: Users or group of users who will be notified by Opsgenie. Defaults to "all".
SOURCE: Alert source
OPENNMS_USER and OPENNMS_PASSWORD: Credentials to authenticate OpenNMS rest API.
OPENNMS_HOST and OPENNMS_PORT: OpenNMS web server host and port which is used for REST API calls.
Prepare opennmsShellScripts/opsgenie shell script :
Copy the shell script anywhere in the same system where OpenNMS installed. This path is pointed to when OpenNMS notification commands are configured.
Configure LAMP_HOME to point your lamp installation directory.
Make the script executable in linux (chmod +x)
Prepare Opsgenie Groups & Users
Create groups or users that you want to notify from Smarts
Make sure groups have at least one user
Add a custom notification command by adding the following section to the $OPENNMS_HOME/etc/notificationCommands.xml configuration file. Check OpenNMS Notification Configuration document for details.
2. Modify the tag so that it points the shell script provided with OpsGenie integration package.
3. Restart OpenNMS server.
4. Add an OpenNMS user and give it a name like "Opsgenie".
5. The user added should be a part of a destination path so that the shell script provided can be executed with OpenNMS.
6. Go to the Admin page, click Configure Notifications in the "Operations" section.
7. Click Configure Destination Paths,
8. Click New Path. Give it a name, like "OpsGenieScriptPath", then click Edit.
9. Add the user by selecting it, then click Next >>>.
10. On the next page, check the "OpsGenie" custom command and on.
11. Click Next >>> again.
12. Finally, click Finish. Now the new destination path appears in the "Existing Paths" section.
Associate OpenNMS events with the new destination path
Go to the Admin page.
Click Configure Notifications in the "Operations" section.
Click Configure Event Notifications.
Click *Add New Event Notification at the top of the Event Notifications page and select "OpenNMS-defined node event: nodeLostService" event.
Click Next >>>.
Click Skip results validation >>> on the next page. Configure the information used to send the notification. Fill in the following values:
Name: Node Lost Service
Choose A Path: OpsGenieShellPath
Text Message: The %service% service poll on interface %interfaceresolve% (%interface%) on node %nodelabel% failed at %time%.
Short Message: %service% down on %interfaceresolve% (%interface%) on node %nodelabel%.
Email Subject: %service% down on %interfaceresolve% (%interface%) on node %nodelabel%.
The notification event in the list will be disabled. Set the radio button to "On" to enable it.
In the main OpenNMS Admin page, there is a radio selector labeled, "Notification Status." Change it to "On" and click update.
To test the integration package, make the OpenNMS server to scan the local PC which runs an HTTP server on port 8080, with the following command:
After the scan completed OpenNMS creates the node, its interfaces, and services including the HTTP server.
When the HTTP server is shut down, OpenNMS detects it in the next service poll and creates a "nodeLostService" event for it.
The event triggers the notification system which executes the shell script installed. As a result a new alert is created in Opsgenie system and most recent outages of my PC are displayed in the Opsgenie console.
Was this helpful?