How-to configure Opsgenie notifications
Starting with version 1.6, Checkmk supports integration with OpsGenie. You can create, close, and acknowledge alerts without needing a custom plugin.
LAST TESTED ON CHECKMK 2.3.0P1
Official Documentation : Notifications via Opsgenie
This guide was tested with the “Essential” subscription. Other subscriptions may require different configurations.
Step-by-step guide
- Log in to your Opsgenie account and create your teams, if they haven't been created already.
In this example, we create two teams and assign team members. - Activate the “Check_MK Integration” for your entire site or for each individual team, if necessary. This will generate the API key(s), which can be stored in the Checkmk Password Store.
Be sure to note them down. - In Checkmk, create a technical user for each team (if each team uses its own API key). Disable the login and assign the “Normal monitoring user” role.
- Configure the “Customer Notification Table” for each user by clicking the “Bell” icon in the user settings.
Configure the Opsgenie notification rule by entering the API key, owner, and responsible team(s) for the alert. Leave all other fields at their default settings.
Note that the responsible team is populated as the “Responder” in the OpsGenie API.
Configuring match conditions is mandatory. For example, you can match only a single “Linux” host.
Avoid overlapping matching criteria when creating two separate Opsgenie notification rules for two team integrations, as the “first one wins.”
- Test your matching conditions using the “Test Notification” tool. Note that no alert will be triggered. In the “$OMD_ROOT/var/log/notify.log” file, you'll see the result of the test as “would notify OpsGenie_User.”
To test the generation of an alert in the OpsGenie API, you can simulate a HARD STATE using the “Fake Check Results” option in the “Services of Host” view.
To directly create a HARD STATE, temporarily set the “Maximum number of check attempts for service” to “1.”
- On your OpsGenie site, the alert is created in the “Alert” section. For example:
You can also create an alert for two responders if it is configured in the OpsGenie notification rule (Responsible Team).
Additional information
- Tags should not contain spaces, as shown in the example. Special characters are allowed. Valid tags include:
team1
,team:1
,team?1
. - To debug notifications, increase the debug level for “Notifications” in the Global Settings (CMK). The output will appear in
~/var/log/cmc.log
. To check for firewall issues, log in to the CMK CLI and test the connection using:
curl -X GET 'https://api.opsgenie.com/v2/teams' --header 'Authorization: GenieKey <your_api_key>' | json_pp
- Currently, the OpsGenie integration uses
api.opsgenie.com/v1/
. This will change tov2
in future CMK releases.
Related articles