Opsview Integration

Opsview is a Nagios-based IT monitoring software. It offers network and server monitoring, enhanced by reporting and performance monitoring.

288

What does Opsgenie offer Opsview users?

Use Opsgenie's Opsview Integration to forward Opsview alerts to Opsgenie. Opsgenie determines the right people to notify based on on-call schedules– notifies via email, text messages (SMS), phone calls and iPhone & Android push notifications, and escalates alerts until the alert is acknowledged or closed.

Functionality of the integration

  • When a host/service alert is created in Opsview, an alert is created in Opsgenie automatically through the integration.
  • When the alert is closed by Opsview, the corresponding alert in Opsgenie is automatically closed.
  • When the alert is acknowledged in Opsview, the corresponding alert in Opsgenie will automatically be acked.

Add Opsview Integration in Opsgenie

  1. Please create an Opsgenie account if you haven't done so already.
  2. Go to Opsgenie's Opsview Integration page.

🚧

For Free and Essentials plans, you can only add the integrations from the Team Dashboards, please use the alternative instructions given below to add this integration.

  1. Specify who is notified of Opsview alerts using the Teams field. Auto-complete suggestions are provided as you type.

📘

An alternative for Step 2) and Step 3) is to add the integration from the Team Dashboard of the team which will own the integration. To add an integration directly to a team, navigate to the Team Dashboard and open Integrations tab. Click Add Integration and select the integration that you would like to add.

  1. Copy the command that includes the API key. It's in the format: nagios2opsgenie -apiKey=[API_KEY]. This key is used in the Opsview configuration later.
  2. Click Save Integration.
2798

🚧

Opsgenie API Url

If you get an error message like "ValidationException[Key format is not valid!]" after sending the request to Opsgenie, then changing "opsgenieApiUrl" to "https://api.opsgenie.com ("https://api.eu.opsgenie.com" for EU users) can fix the problem.

Installing the Opsview Plugin

For Red Hat Based Distributions

  1. Download Opsgenie Opsview plugin.
  2. Run the following command:
sudo rpm -i opsgenie-opsview-<your_version>.rpm

For Debian Based Distributions

  1. Download Opsgenie Opsview plugin.
  2. Run the following command:
sudo dpkg -i opsgenie-opsview-<your_version>.deb

📘

Configure the golang-executable to use a proxy for sending HTTP requests by defining the environment variable HTTP_PROXY=http://host:port

Configuration in Opsview

  1. In your Opsview Manager, go to Settings > Notification Methods.
  2. Define a new Notification method named opsgenie. Paste the command provided by Opsgenie, that's in the format nagios2opsgenie -apiKey=[API_KEY] -opsgenieApiUrl=[API_URL]
  3. Click Submit Changes.
1214

Additionally, the nagios2opsgenie executable accepts the following flags:

Flag
apiKey nagios2opsgenie uses this key to authenticate to Opsgenie. API key is also used to identify the right integration configuration that should be used to process alerts.
teams Teams field is used to specify which teams are notified for the Opsview alerts.
tags Tags field is used to specify the tags of the alert that created in Opsgenie.
logPath Specifies the full path of the log file. (Default value is /var/log/opsgenie/nagios2opsgenie.log)
logLevelPossible values are debug, info, warning, error. Default value is warning.
opsgenieApiUrlIf you're using Opsgenie from another domain(eg. EU, sandbox), update this configuration.

📘

To send additional custom arguments, add them after the flags as: customArgName1 customArgValue1 customArgName2 customArgValue2
Parse custom arguments by adding {{_payload.customArgName}} to wherever is needed on the input fields.
For more information about using raw parameters please visit Dynamic Fields document.

Sample Webhook Message from Opsgenie Opsview Plugin

{
  "NAGIOS_LASTHOSTPROBLEMID": "32",
  "NAGIOS_LASTSERVICECHECK": "1497942090",
  "NAGIOS_SERVICESTATE": "WARNING",
  "NAGIOS_HOSTALIAS": "Opsview Master S'erver ",
  "NAGIOS_SHORTDATETIME": "2017-06-20 07:01:30",
  "NAGIOS_SERVICESTATETYPE": "HARD",
  "NAGIOS_CONTACTPAGER": "NAGIOS_CONTACTPAGER",
  "NAGIOS_LONGHOSTOUTPUT": "NAGIOS_LONGHOSTOUTPUT",
  "NAGIOS_CONTACTALIAS": "Administrator",
  "NAGIOS_LASTSERVICECRITICAL": "1497942030",
  "NAGIOS_LASTSERVICESTATE": "WARNING",
  "NAGIOS_LASTHOSTSTATECHANGE": "1497889073",
  "NAGIOS_LONGSERVICEOUTPUT": "NAGIOS_LONGSERVICEOUTPUT",
  "NAGIOS_SERVICESTATEID": "1",
  "NAGIOS_LASTSERVICESTATECHANGE": "1497942030",
  "NAGIOS_SERVICENOTES": "Application - Opsview:Monitors how long it has been since housekeeping cronjob was successfully run ",
  "NAGIOS_SERVICENOTIFICATIONNUMBER": "0",
  "NAGIOS_HOSTGROUPNAME": "Monitoring Servers",
  "NAGIOS_HOSTDOWNTIME": "0",
  "NAGIOS_HOSTPROBLEMID": "0",
  "NAGIOS_LASTHOSTUNREACHABLE": "0",
  "NAGIOS_CONTACTGROUPLIST": "k4_opsview-components,hostgroup2_servicegroup3",
  "NAGIOS_SERVICEDURATION": "0d 0h 1m 0s",
  "NAGIOS_NOTIFICATIONCOMMENT": "NAGIOS_NOTIFICATIONCOMMENT",
  "NAGIOS_HOSTADDRESS": "localhost",
  "NAGIOS_LASTHOSTDOWN": "1497889073",
  "NAGIOS_SERVICEACKCOMMENT": "NAGIOS_SERVICEACKCOMMENT",
  "NAGIOS_CONTACTNAME": "admin/01receiveallalertsduringworkhours",
  "NAGIOS_HOSTSTATE": "UP",
  "NAGIOS_HOSTSTATEID": "0",
  "NAGIOS_LASTHOSTCHECK": "1497942030",
  "NAGIOS_NOTIFICATIONNUMBER": "0",
  "NAGIOS_HOSTACKAUTHOR": "NAGIOS_HOSTACKAUTHOR",
  "NAGIOS_LASTSERVICEPROBLEMID": "14",
  "NAGIOS_SERVICEDOWNTIME": "0",
  "NAGIOS_LASTHOSTUP": "1497942030",
  "NAGIOS_HOSTATTEMPT": "1",
  "NAGIOS_HOSTGROUPALIAS": "Monitoring Servers",
  "NAGIOS_LONGDATETIME": "Tue Jun 20 07:01:30 UTC 2017",
  "NAGIOS_HOSTACKCOMMENT": "NAGIOS_HOSTACKCOMMENT",
  "NAGIOS_CONTACTEMAIL": "dummy@localhost",
  "NAGIOS_HOSTDURATION": "0d 14h 43m 37s",
  "NAGIOS_HOSTNOTIFICATIONNUMBER": "0",
  "NAGIOS_HOSTOUTPUT": "OK - localhost: rta 0.016ms, lost 0%",
  "NAGIOS_HOSTSTATETYPE": "HARD",
  "NAGIOS_LASTHOSTSTATE": "UP",
  "NAGIOS_SERVICEACKAUTHOR": "NAGIOS_SERVICEACKAUTHOR",
  "NAGIOS_TIMET": "1497942090",
  "NAGIOS_LASTSERVICEOK": "1497941970",
  "NAGIOS_SERVICEOUTPUT": "CRONJOBS WARNING - Housekeeping cronjob stat file indicates the job has not run yet",
  "NAGIOS_SERVICEPROBLEMID": "78",
  "NAGIOS_NOTIFICATIONAUTHOR": "NAGIOS_NOTIFICATIONAUTHOR",
  "NAGIOS_LASTSERVICEWARNING": "1497942090",
  "NAGIOS_LASTSTATECHANGE": "NAGIOS_LASTSTATECHANGE",
  "NAGIOS_NOTIFICATIONTYPE": "FLAPPINGSTART",
  "NAGIOS_SERVICEATTEMPT": "3",
  "NAGIOS_SERVICEDESC": "Opsview Housekeeping Cronjob Monitor",
  "NAGIOS_HOSTNAME": "opsview",
  "apiKey": "token",
  "teams": "team1, team2",
  "tags": "tag1, tag2"
}