This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

Pushing OpsGenie alert changes into Solarwinds with Marid

2016-06-12 Updated script: Solarwinds 12.x appears to have deprecated the AddNote() action for the Orion.AlertStatus object so that it can't append comments to alerts for some kinds of Solarwinds objects (e.g. Hardware Sensors). Instead, you must use the AppendNote() action and the Orion.AlertActive object if you want this script to work reliably with alerts for all kinds of Solarwinds objects. To use the new script, you must make three changes in Solarwinds and in OpsGenie.

  1. In any Solarwinds alert action that sends updates to OpsGenie, add the line "AlertObjectID=${N=Alerting;M=AlertObjectID}&" to the POST body. Orion.AlertActive.AppendNote() requires this value.
  2. In OpsGenie, modify your Solarwinds integration. In the "Extra Properties" section, add an entry with the name "AlertObjectID" (no quotes) and the value "{{AlertObjectID}}" (no quotes).
  3. In OpsGenie, modify your Marid integration. In the "Extra Properties" section, add an entry with the name "AlertObjectID" (no quotes) and the value "{{AlertObjectID}}" (no quotes).

Description

We're using OpsGenie to notify our on-call engineers when an alert is triggered in Solarwinds. OpsGenie provides a pre-built integration tool for getting Solarwinds alerts into OpsGenie. However, they don't deliver a method for getting updates to OpsGenie alerts back into Solarwinds. I wanted the engineers to be able to manage both the OpsGenie alert and the original Solarwinds alert with a single action.

OpsGenie provides the Marid integration server free of charge. The Marid server subscribes to your OpsGenie account and is aware of any updates to your OpsGenie alert actions (close, delete, add note, acknowledge, etc.).

I created the Groovy script SolarwindsActionHandler.groovy to act on OpsGenie's Close, Acknowledge, and AddNote actions. When everything is configured, closing or acknowledging an alert in OpsGenie will acknowledge the corresponding alert in Solarwinds (since you can't manually close an alert in Solarwinds). Adding a note in OpsGenie will add a comment to the alert in Solarwinds.

Requirements

An OpsGenie account, configured to handle alerts originating from your Solarwinds server

A Marid installation on a server you manage

A Solarwinds account that can acknowledge alerts

Configure OpsGenie

Edit your Solarwinds integration. In the "Extra Properties" section, add an entry with the name "AlertObjectID" (no quotes) and the value "{{AlertObjectID}}" (no quotes).

pastedImage_8.png

Edit your Marid integration. In the "Extra Properties" section, add an entry with the name "AlertObjectID" (no quotes) and the value "{{AlertObjectID}}" (no quotes).

pastedImage_9.png

Configure Marid

Copy the attached script SolarwindsActionHandler.groovy to the /var/ops/opsgenie/marid/scripts directory on your Marid server. Correct the permissions and ownership:

chmod 775 /var/ops/opsgenie/marid/scripts/SolarwindsActionHandler.groovy 
chown opsgenie:opsgenie /var/ops/opsgenie/marid/scripts/SolarwindsActionHandler.groovy

Edit /etc/opsgenie/marid/marid.conf  as follows.

Find the lines beginning with:

actions.AddNote.script= 
actions.Close.script=
actions.Acknowledge.script=

and change them to:

actions.AddNote.script=SolarwindsActionHandler.groovy 
actions.Close.script=SolarwindsActionHandler.groovy
actions.Acknowledge.script=SolarwindsActionHandler.groovy

Add this section at the end of the file, substituting appropriate values for your Solarwinds installation:

solarwinds.url=https://<your solarwinds server IP or FQDN>:17778
solarwinds.host=<your solarwinds server IP or FQDN>
solarwinds.login=<name of Solarwinds user that can acknowledge alerts>
solarwinds.password=<password for Solarwinds user that can acknowledge alerts>

Restart Marid:

service marid restart
SolarwindsActionHandler.groovy
Parents
  • Hi,

    We are trying to integrate the OPsgenie to Solarwinds and as part of it I am trying to configure Opsgenie create and close alert with a specific test device with a particular alert condition. By using send GET or POST request to server I have added the opsgenie API key URL and added variables. After creating alert, I have tested the alert, I can see the alert being generated in Solarwinds but http request to opsgenie is getting failed. No communication is being initiated to Opsgenie to check the logs from their end. I have approached Solarwinds but they finally said that we are only supporting our licensed products but not the integration to other tools. Can someone please help on what the issue is causing the http request to fail.

Reply
  • Hi,

    We are trying to integrate the OPsgenie to Solarwinds and as part of it I am trying to configure Opsgenie create and close alert with a specific test device with a particular alert condition. By using send GET or POST request to server I have added the opsgenie API key URL and added variables. After creating alert, I have tested the alert, I can see the alert being generated in Solarwinds but http request to opsgenie is getting failed. No communication is being initiated to Opsgenie to check the logs from their end. I have approached Solarwinds but they finally said that we are only supporting our licensed products but not the integration to other tools. Can someone please help on what the issue is causing the http request to fail.

Children
No Data