Overview
What does the integration offer?
Jira Service Management provides a powerful bidirectional integration with OP5. When a new alert - host or service - is created in OP5, a corresponding Jira Service Management alert is automatically created, containing rich information about the alert. Jira Service Management provides detailed notifications with on-call rotations, scheduling features, and alert escalations. Users select any of the alert actions of Jira Service Management to map to the Acknowledge action of OP5.
How does the integration work?
OP5 to Jira Service Management
When a host or service alert is created on OP5, an alert is created in Jira Service Management.
When a host or service alert is closed on OP5, the corresponding alert is closed in Jira Service Management.
When a host or service alert is acknowledged on OP5, the corresponding alert is acknowledged in Jira Service Management.
Jira Service Management to OP5
If Send alert updates back to OP5 is selected, actions that are run on OP5 alerts are sent to OP5 as acknowledgment actions.
Set up the integration
OP5 is a bidirectional integration. Setting it up involves the following steps:
Add an OP5 integration in Jira Service Management
Map alert actions
Configure the integration in OP5
Install the OP5 Package
Download the latest version of JEC
To download the latest version of OP5 packages, use this repository.
For OP5 Monitor's Red Hat-based distributions
Either share the OP5 file to the remote OP5 monitor or copy the link on the opening page.
Run the following command:
wget https://linkTo.the.OP5Package
Run the following command :
rpm -i opsgenie-op5-<your_version>.rpm
During upgrades, the rpm package does not overwrite existing configuration. It saves the new default configuration file as opsgenie-integration.conf.rpmnew. Find more information about rpm upgrade config file handling from here.
To update from version 201X-XX-XX to 2.X.X, add the --force
parameter. For example:
rpm -U --force opsgenie-integration-<your_version>.rpm
We suggest that you backup your configuration files before updating.
If while installing the rpm package you get an error that the package is obsolete, use "rpm -i opsgenie-op5-<your_version>.rpm --nodeps" instead.
If you get "is already installed" error, use "rpm -i opsgenie-op5-<your_version>.rpm --force" instead.
Adding OP5 integration
You can add this integration from your team dashboard
If you're using Opsgenie's Free or Essentials plan, or if you’re using Opsgenie with Jira Service Management's Standard plan, you can only add this integration from your team dashboard as the Integrations page under Settings is not available in your plan.
Adding the integration from your team dashboard will make your team the owner of the integration. This means Opsgenie will assign the alerts received through this integration to your team only.
To do that,
Go to your team’s dashboard from Teams,
Select Integrations, and select Add integration.
Follow the rest of the steps to complete the integration.
Go to your team’s operations page.
On the left navigation panel, select Integrations and then Add integration.
Run a search and select “OP5”.
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 integration API key.
You will use this key while configuring the integration in OP5 later.Select Turn on integration.
The rules you create for the integration will work only if you turn on the integration.
Configure OP5 package in OP5 Monitor
The plugin uses a golang-executable file (included in the plugin as send2opsgenie) to create, acknowledge, and close alerts in Jira Service Management. Configure OP5 to execute this file on events to create, acknowledge, and close alerts in Jira Service Management.
Setting the apiKey is required. Other configuration parameters are set to defaults that work with OP5.
Configuration parameters | Description | Location |
---|---|---|
apiKey | Copy the API key from the OP5 integration created above. send2opsgenie uses this key to authenticate to Jira Service Management. API key is also used to identify the right integration configuration that should be used to process alerts. | /home/opsgenie/oec/conf/config.json |
baseUrl | If you're using Jira Service Management from another domain(eg. EU, sandbox), you should update this configuration.Opsgenie OP5 integration, Advanced Settings page. | /home/opsgenie/oec/conf/config.json |
responders | Responders field is used to specify which teams should be notified for the OP5 alerts. This field is used to set the default teams field value. Modify to route different alerts to different teams in integration settings. | /home/opsgenie/oec/conf/opsgenie-integration.conf |
tags | Tags field is used to specify the tags of the alert that created in Jira Service Management. | /home/opsgenie/oec/conf/opsgenie-integration.conf |
logPath | Specifies the full path of the log file. (Default value is /var/log/opsgenie/send2opsgenie.log) | /home/opsgenie/oec/conf/opsgenie-integration.conf |
nagios2opsgenie.http.proxy.enabled | nagios2opsgenie.http.proxy.enabled field is to enable/disable external proxy configuration. The default value is false. | /home/opsgenie/oec/conf/opsgenie-integration.conf |
nagios2opsgenie.http.proxy.host | It is the host of the proxy. | /home/opsgenie/oec/conf/opsgenie-integration.conf |
nagios2opsgenie.http.proxy.port | It is the port of the proxy. | /home/opsgenie/oec/conf/opsgenie-integration.conf |
nagios2opsgenie.http.proxy.scheme | It is the proxy connection protocol. It may be http or https depending on your proxy servers. Its default value is http. | /home/opsgenie/oec/conf/opsgenie-integration.conf |
nagios2opsgenie.http.proxy.username | It is the proxy authentication username. | /home/opsgenie/oec/conf/opsgenie-integration.conf |
nagios2opsgenie.http.proxy.password | It is the proxy authentication password. | /home/opsgenie/oec/conf/opsgenie-integration.conf |
There are three ways to configure golang-executable files:
Configuring from conf file: Configure from /home/opsgenie/oec/conf/opsgenie-integration.conf file. Configuring from conf file overwrites the configurations made in the script.
Configuring by using Golang Flags: Configure by entering flags to command in the opsgenie.cfg file. Use -apiKey flag for the apiKey and -ns flag for nagios_server name. If multiple OP5 servers are not in use, there is no need to define the nagios server. Using flags overwrites all the other configuration methods mentioned above.
Configure the apiKey from the cfg file as follows:
define command { command_name notify-service-by-opsgenie command_line /home/opsgenie/oec/opsgenie-op5/send2opsgenie -apiKey="apiKey1" -entityType=service ... }
When apiKey is added to the cfg file, it overrides the apiKey in the config.json file.
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 in the input fields.
For more information about using raw parameters please visit Dynamic Fields document.
Configuring from script: Configure apiKey and nagios_server from send2opsgenie.go script. To use this option, build the script again and put the new executable to /usr/bin directory. Find information about the location of the send2opsgenie.go and how to build a go script in the "Source" section.
Define Jira Service Management as Contact
Log in to your OP5 monitor.
Go to your /opt/monitor/etc directory where you'll find nagios.cfg.
cd /opt/monitor/etc
Add the following line to main Nagios configuration file (nagios.cfg).
... cfg_file=opsgenie.cfg ...
Reboot the monitor to see the "opsgenie" contact in the contact list.
Add the contact "opsgenie" to the OP5 Monitor’s main contact group.
If everything goes well, alerts are created in Jira Service Management for every notification created in OP5.
Optional: Configure Jira Service Management to update OP5
Use Jira Service Management’s JEC and the OP5 script to update alerts on OP5. This enables deployment of your own scripts/ability to modify the ones provided and execute customized actions on OP5.
To be able to execute actions in OP5, JEC gets the configuration parameters from the configuration file. The configuration file can be found under /home/opsgenie/oec/conf/config.json.
Configuration parameters
url – JEC posts alert actions to an endpoint which is constructed using this URL.
username – JEC uses your OP5 account's username to authenticate.
password – JEC uses your OP5 account's password to authenticate.
The package that you downloaded also includes OEC utility which is located under /usr/local/bin and the script that is needed to be run by JEC which is under /home/opsgenie/oec/scripts. After the configuration of JEC is done, you need to run it. In order to learn more about how to run JEC, refer to the Running OEC documentation.
FAQ and troubleshooting
If the integration is not working, review this section and follow the guidance prescribed:
1. OP5 alerts are not getting created in Jira Service Management
2. The OP5 alert is not acknowledged when acknowledged in Jira Service Management
If unsure of the problem, set the OEC's script log level to debug, try again, and contact us and share the log files under /var/log/jsm/.
Map alert actions
You can define mappings between Jira Service Management actions and OP5 actions (also when the source of the alert is OP5), which requires additional authentication for your OP5 account.
Username: The username of your OP5 account
Password: The password of your OP5 account
OP5 Monitor URL: This is the domain name of your OP5 Monitor. For example: https://19.167.1.143
For alerts created by OP5
In the Send alert updates back to OP5 section, map Jira Service Management actions to OP5 actions when the source of the alert is OP5 (when the alert is created by OP5 integration itself). Map different Jira Service Management actions to different OP5 actions. For example, acknowledge the alert in OP5, when the alert is acknowledged from OP5. To do this, define If alert is acknowledged in Jira Service Management, acknowledge in OP5 mapping in Send alert updates back to OP5 section.
Source for send2jsm and recompiling
The source for the executable send2jsm is found in /usr/bin/ and send2jsm.go, in /home/jsm/jec/scripts respectively and is also available in this repository. To change the behavior of the executable, edit send2jsm.go and build it by using the following command: go build send2jsm.go
For installing go, refer to http://golang.org/doc/install. Note that the executable in the plugin is built for linux/amd64 systems.
0 Comments