Werk #7195: Jira: Notification plugin
Component | Notifications | ||
Title | Jira: Notification plugin | ||
Date | Mar 6, 2019 | ||
Level | Prominent Change | ||
Class | New Feature | ||
Compatibility | Compatible - no manual interaction needed | ||
Checkmk versions & editions |
|
Check_MK now supports integration with Jira. You can create issues for Host an Service Problems and optional set a resolution on recovery notifications.
In Jira you have to add two custom fields to your project screen as described here.
In Check_MK, under "WATO - Notifications", create a new notification rule and select Jira.
Parameters to set: * JIRA URL: The URL to your Jira environment * User Name: Jira username * Password: Jira password * Project ID: The Project ID the issues should be created in * Issue type ID: The issue type ID * Host custom field ID: The first custom field ID you created in Jira * Service custom field ID: The second custom field ID you created in Jira * Monitoring URL: URL of your Check_MK environment to create hyperlinks back to Check_MK (eg. https://server/site) * Priority ID: The priority ID (optional) * Summary for host notifications: The summary the created host issue should use (optional) * Summary for service notifications: The summary the created service issue shoud use (optional) * Label: Label for Jira issues. If not set, 'monitoring' will be used. (optional) * Activate resultion with following resolution transistion ID: If set, the created issue will be resolved with the configured resolution ID (optional) * Set optional timeout for connections to JIRA: Timeout in seconds, default is 10 (optional)
You need different Jira IDs to open/resolve issues. There are different ways to get this IDs: * Jira_support * Retrieve with the a script (example: project_id):
example_script.py
#!/usr/bin/env python
import requests
USER = "JIRA_USERNAME"
PW = "JIRA_PASSWORD"
PROJECT_KEY = "JIRA_PROJECT_NAME"
JIRA_SERVER = "https://jira.server.your-domain.de"
sess = requests.Session()
sess.auth = (USER, PW)
resp = sess.get("%s/rest/api/2/project" % JIRA_SERVER, verify=False)
project_id = [item["id"] for item in resp.json() if item["key"] == PROJECT_KEY][0]
print(project_id)
For issuetype and priority ID use:
example_script.py
resp = sess.get("%s/rest/api/2/issuetype" % JIRA_SERVER)
resp = sess.get("%s/rest/api/2/priority" % JIRA_SERVER)
More information about the Jira API can be found here.
CMK-1185