CMK version: Enterprise Checkmk 1.6.0p13 OS version: Error message: No error messages received. But alerts are not received in Opsgenie Output of “cmk --debug -vvn hostname”: (If it is a problem with checks or plugins)
Relevant lines from /var/log/notify.log
2022-05-26 08:36:36 Got raw notification (xxxxxxxxxxxx) context with 71 variables
2022-05-26 08:36:36 Global rule 'Opsgenie'...
2022-05-26 08:36:36 -> matches!
2022-05-26 08:36:36 - adding notification of <xxxxxxx> via opsgenie
Executing 2 notifications:
2022-05-26 08:36:36 * notifying <xxxxxxx> via opsgenie, parameters: https://api.eu.opsgenie.com/v1/json/checkmk?apiKey=<xxxxxxxxxxxxxx>, bulk: no
2022-05-26 08:36:36 Creating spoolfile: /omd/sites/xxxxxx/var/check_mk/notify/spool/6aa3bdef-xxxxxxxxxxxxxxxxxx
2022-05-26 08:36:40 Got spool file 6aa3bdef (xxxxxxxxxxxxxxxxxxx) for local delivery via opsgenie
2022-05-26 08:36:40 executing /omd/sites/xxxxxx/local/share/check_mk/notifications/opsgenie
I didn’t modify anything on ~/share/check_mk/ instead I put the plugin under /omd/sites/xxxxxx/local/share/check_mk/notifications/. From notify logs it shows that the script executed but not receiving alerts in opsgenie
we replaced that script by the same version in powershell (2.1) and it works just fine, so if you install powershell on your checkmk server, I can share the script.
The rest of the setup is the same, just replace the content of the script
@robin.gierse I have opened a thread here. When I run the script in the server with dummy data it is working fine.While putting the script under /omd/sites/xxxxxx/local/share/check_mk/notifications/ it is not working and throws the error
#!/usr/bin/env python3
# OpsGenie_integration
import json
import os
import requests
context= dict([(var[7:], value)
for (var, value) in os.environ.items()
if var.startswith("NOTIFY_")])
if "PARAMETER_1" in context:
opsgenie_api_url = context["PARAMETER_1"]
if "PARAMETER_1" in context.keys():
del context["PARAMETER_1"]
if "PARAMETERS" in context.keys():
del context["PARAMETERS"]
else:
print( "No API Key Specified.")
print("requesting")
newheader={"Content-Type": "application/json"}
response = requests.post(opsgenie_api_url, data=json.dumps(context), headers=newheader)
print(response.status_code)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.