Integrate with Opsview
Use Compass's Opsview Integration to forward Opsview alerts to Compass. Compass determines the right people to notify based on on-call schedules, notifies via email, text messages (SMS), phone calls, and iOS and Android push notifications, and escalates alerts until the alert is acknowledged or closed.
How does the integration work?
When a host/service alert is created in Opsview, an alert is created in Compass automatically through the integration.
When the alert is closed by Opsview, the corresponding alert in Compass is automatically closed.
When the alert is acknowledged in Opsview, the corresponding alert in Compass will automatically be acked.
Set up the integration
Opsview is an API integration. Setting it up involves the following steps:
Add an Opsview integration in Compass
Configure the integration in Opsview
Add an Opsview integration
In this release, only incoming integrations are fully supported in the Standard plan, at a team level. To use outgoing integrations or the outgoing part of bidirectional integrations, upgrade to a higher subscription plan. There may be restrictions on how you can create and apply integration rules as well.
You can add this integration only from your team’s operations page. Adding an integration from your team’s operations page makes your team the owner of the integration. This means Compass only assigns the alerts received through this integration to your team.
To add an Opsview integration in Compass, complete the following steps:
Go to your team’s operations page.
On the left navigation panel, select Integrations and then Add integration.
Run a search and select “Opsview”.
On the next screen, enter a name for the integration.
Optional: Select a team in Assignee team if you want a specific team to receive alerts from the integration.
Select Continue.
The integration is saved at this point.Expand the Steps to configure the integration section and copy the command that includes the API key. It's in the format: nagios2jsm -apiKey=[API_KEY].
You will use this key while configuring the integration in Opsview later.Select Turn on integration.
The rules you create for the integration will work only if you turn on the integration.
Install the Opsview Plugin
Opsview V6 and above
For RedHat-based distributions, download Opsgenie Opsview plugin.
For Debian Based Distributions, download Opsgenie Opsview plugin.
For RedHat-based distributions
Download Opsgenie Opsview plugin.
Run the following command:
Text
sudo rpm -i jsm-opsview-<your_version>.rpm
# for Opsview v6 and above
sudo rpm -i jsm-opsviewv6-<your_version>.rpm
For Debian-based distributions
Download Opsgenie Opsview plugin.
Run the following command:
Text
sudo dpkg -i jsm-opsview_<your_version>.deb
# for Opsview v6 and above
sudo dpkg -i jsm-opsviewv6_<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
Configure the integration in Opsview
To configure the integration of Opsview with Compass, complete the following steps:
In Opsview Manager, go to Settings > Notification Methods.
Define a new notification method named jsm.
Paste the following as the command for jsm:
nagios2jsm -apiKey=d9a3b025-eb6b-4c6f-a043-046f330c00eb -jsmApiUrl=https://api.atlassian.com
.Select Submit Changes.
In case of Opsview v6 and above, when creating a new Notification Method, Opsview does not allow using slash character ("/") in commands. Because of this you should remove "https://" part of the Compass API URL.
The nagios2jsm executable accepts the following flags:
apiKey – nagios2jsm uses this key to authenticate to Compass. 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 Compass.
logPath – Specifies the full path of the log file. (Default value is /var/log/jsm/nagios2jsm.log)
logLevel – Possible values are debug, info, warning, error. Default value is warning.
jsmApiUrl – If you're using Compass from another domain(eg. EU, sandbox), update this configuration.
Sample webhook message from the Opsview Plugin
JSON
{
"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"
}