Integrate with Checkmk
This article explains integrating Compass with Checkmk 1.5.0 and earlier versions. If you're using Checkmk 1.6.0 and above you can use a default Compass API integration to create this integration. Find out how to create a default API integration.
What does the integration offer?
Use Compass’s Checkmk Integration to forward Checkmk notifications to Compass. Compass determines the right people to notify based on on-call schedules– notifies via email, text messages (SMS), phone calls and iOS & Android push notifications, and escalates alerts until the alert is acknowledged or closed.
How does the integration work?
When a host or service state becomes down in Checkmk, an alert is created in Compass.
When the problem is acknowledged in Checkmk, the alert is acknowledged in Compass.
When the state of host becomes UP or the state of service becomes OK again in Checkmk, the alert is closed in Compass.
Set up the integration
Checkmk is an API integration. Setting it up involves the following steps:
Add a Checkmk integration in Compass
Configure the integration in Checkmk
Add a Checkmk 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 a Checkmk 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 “Checkmk”.
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 URL.
You will use this URL while configuring the integration in Checkmk later.Select Turn on integration.
The rules you create for the integration will work only if you turn on the integration.
Configure the Checkmk plugin
To configure the Checkmk plugin, complete the following steps:
Grant permissions as necessary to the script by using the following command:
sudo chmod +x jsm
Copy the plugin into
/omd/sites/[site name]/local/share/check_mk/notifications/, if you're using OMD version.
/usr/share/check_mk/notifications, if you're using standalone version.
Configure the integration in Checkmk
To configure the integration in Checkmk, complete the following steps:
In Checkmk, select Users on the left under the WATO Configuration box.
Select New User at the top.
Enter a username and a full name for this new user.
Leave the Authentication part blank and check disable the login to this account to value.
Select Normal monitoring user for the Roles.
Select Save.
After creating the new user, you are redirected to Users page again.
Select the notification button under Actions column for the newly created user.
Select New Rule at the top.
Enter JSM for the Description.
Select JSM as the Notification Method.
Note: Due to an issue with Checkmk, you'll see two entries. The one which asks forCall with forwarding parameters
is the correct one. Avoid using the one which asks forAPI key
.Paste the API URL copied previously into the textbox under Call with the following parameters: combobox.
Select Save.
After saving, select Main Menu on the left under WATO Configuration box.
Select the orange button labeled # Changes at the top.
Select Activate Changes at the top of the newly opened page.
Sample webhook message from the Checkmk plugin
JSON
{
"LASTSERVICESTATECHANGE_REL": "0d 00:00:01",
"LASTSERVICESTATE": "OK",
"HOSTCHECKCOMMAND": "check-mk-host-smart",
"HOSTSTATE": "UP",
"LASTHOSTUP_REL": "0d 00:00:03",
"HOSTNOTESURL": "",
"SERVICEDESC": "CPU utilization",
"SERVICEPERFDATA": "user=88.272;;;; system=11.728;;;; wait=0.000;;;; steal=0;;;; guest=0;;;;",
"HOSTTAGS": "/wato/ cmk-agent ip-v4 ip-v4-only lan prod site:og tcp wato",
"HOSTPERFDATA": "",
"SERVICEATTEMPT": "1",
"LASTHOSTSHORTSTATE": "UP",
"NOTIFICATIONCOMMENT": "",
"SERVICESHORTSTATE": "CRIT",
"MAXSERVICEATTEMPTS": "1",
"MAIL_COMMAND": "mail -s '\$SUBJECT\\\$' '\$CONTACTEMAIL\\\$'",
"HOSTNAME": "localhost",
"LASTHOSTSTATECHANGE": "1478611924",
"SERVICESTATE": "CRITICAL",
"SERVICEGROUPNAMES": "",
"SERVICENOTESURL": "",
"SERVICEACKCOMMENT": "",
"HOST_TAGS": "/wato/ cmk-agent ip-v4 ip-v4-only lan prod site:og tcp wato",
"SHORTDATETIME": "2016-11-10 13:20:42",
"CONTACTPAGER": "",
"LASTSERVICESTATECHANGE": "1478773242",
"LONGSERVICEOUTPUT": "",
"HOSTPROBLEMID": "0",
"CONTACTNAME": "jiraservicemanagement",
"LONGHOSTOUTPUT": "",
"MONITORING_HOST": "ubuntu-pc",
"HOSTATTEMPT": "1",
"SERVICEFORURL": "CPU%20utilization",
"WHAT": "SERVICE",
"HOSTALIAS": "localhost",
"SERVICE_EC_CONTACT": "",
"SERVICEACKAUTHOR": "",
"HOST_FILENAME": "/wato/hosts.mk",
"SERVICECHECKCOMMAND": "check_mk-kernel.util",
"LASTSERVICESTATEID": "0",
"LASTSERVICEOK": "1478773181",
"HOSTDOWNTIME": "0",
"SERVICEPROBLEMID": "48",
"HOST_SL": "",
"NOTIFICATIONAUTHORALIAS": "",
"HOST_ADDRESS_4": "127.0.0.1",
"HOST_ADDRESS_6": "",
"SERVICEOUTPUT": "CRIT - user: 88.3%, system: 11.7%, wait: 0.0%, steal: 0.0%, guest: 0.0%, total: 100.0% (warn/crit at 40.0%/60.0%)(!!)",
"CONTACTALIAS": "jiraservicemanagement",
"HOSTADDRESS": "127.0.0.1",
"SERVICENOTIFICATIONNUMBER": "1",
"SERVICEDOWNTIME": "0",
"NOTIFICATIONAUTHORNAME": "",
"HOSTGROUPNAMES": "check_mk",
"HOSTSHORTSTATE": "UP",
"HOSTNOTIFICATIONNUMBER": "1",
"OMD_ROOT": "/omd/sites/og",
"LASTHOSTSTATECHANGE_REL": "1d 20:48:39",
"PREVIOUSHOSTHARDSTATEID": "0",
"LASTSERVICESHORTSTATE": "OK",
"CONTACTEMAIL": "",
"PREVIOUSSERVICEHARDSHORTSTATE": "OK",
"HOST_ADDRESS_FAMILY": "4",
"HOSTACKAUTHOR": "",
"HOSTURL": "/check_mk/index.py?start_url=view.py%3Fview_name%3Dhoststatus%26host%3Dlocalhost",
"HOSTSTATEID": "0",
"MICROTIME": "1478773242189620",
"LASTSERVICEPROBLEMID": "48",
"PREVIOUSSERVICEHARDSTATE": "OK",
"SERVICEDISPLAYNAME": "CPU utilization",
"NOTIFICATIONTYPE": "PROBLEM",
"LOGDIR": "/omd/sites/og/var/check_mk/notify",
"MAXHOSTATTEMPTS": "1",
"OMD_SITE": "og",
"HOSTACKCOMMENT": "",
"PREVIOUSSERVICEHARDSTATEID": "0",
"SERVICE_SL": "",
"DATE": "2016-11-10",
"HOSTOUTPUT": "Packet received via smart PING",
"NOTIFICATIONAUTHOR": "",
"HOSTFORURL": "localhost",
"LASTHOSTSTATEID": "0",
"SERVICESTATEID": "2",
"LASTHOSTUP": "1478773240",
"PREVIOUSHOSTHARDSTATE": "UP",
"LASTSERVICEOK_REL": "0d 00:01:02",
"HOSTCONTACTGROUPNAMES": "all",
"HOST_EC_CONTACT": "",
"SERVICECONTACTGROUPNAMES": "all",
"CONTACTS": "jiraservicemanagement",
"LASTHOSTPROBLEMID": "0",
"SVC_SL": "",
"LASTHOSTSTATE": "UP",
"PREVIOUSHOSTHARDSHORTSTATE": "UP",
"LONGDATETIME": "Thu Nov 10 13:20:42 +03 2016",
"SERVICEURL": "/check_mk/index.py?start_url=view.py%3Fview_name%3Dservice%26host%3Dlocalhost%26service%3DCPU%20utilization"
}