Opsgenie notification doesn't works at Checkmk 2.0.0p3 @ json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

It is a fresh new docker installation from check-mk-enterprise-docker-2.0.0p3.tar.gz.

2021-04-19 08:09:47,161 [20] [cmk.base.notify] executing /omd/sites/<OMD_SITE>/share/check_mk/notifications/opsgenie_issues
2021-04-19 08:09:47,594 [20] [cmk.base.notify] Output: Traceback (most recent call last):
2021-04-19 08:09:47,595 [20] [cmk.base.notify] Output: File “/omd/sites/<OMD_SITE>/share/check_mk/notifications/opsgenie_issues”, line 14, in
2021-04-19 08:09:47,595 [20] [cmk.base.notify] Output: sys.exit(opsgenie_issues.main())
2021-04-19 08:09:47,595 [20] [cmk.base.notify] Output: File “/omd/sites/<OMD_SITE>/lib/python3/cmk/notification_plugins/opsgenie_issues.py”, line 182, in main
2021-04-19 08:09:47,595 [20] [cmk.base.notify] Output: return connector.handle_alert_creation(
2021-04-19 08:09:47,595 [20] [cmk.base.notify] Output: File “/omd/sites/<OMD_SITE>/lib/python3/cmk/notification_plugins/opsgenie_issues.py”, line 68, in handle_alert_creation
2021-04-19 08:09:47,596 [20] [cmk.base.notify] Output: response = self.alert_api.create_alert(create_alert_payload=body)
2021-04-19 08:09:47,596 [20] [cmk.base.notify] Output: File “/omd/sites/<OMD_SITE>/lib/python3/opsgenie_sdk/api/alert/init.py”, line 1136, in create_alert
2021-04-19 08:09:47,596 [20] [cmk.base.notify] Output: (data) = self.create_alert_with_http_info(create_alert_payload, **kwargs) # noqa: E501
2021-04-19 08:09:47,596 [20] [cmk.base.notify] Output: File “/omd/sites/<OMD_SITE>/lib/python3/opsgenie_sdk/api/alert/init.py”, line 1197, in create_alert_with_http_info
2021-04-19 08:09:47,596 [20] [cmk.base.notify] Output: return self.api_client.call_api(
2021-04-19 08:09:47,596 [20] [cmk.base.notify] Output: File “/omd/sites/<OMD_SITE>/lib/python3/opsgenie_sdk/api_client.py”, line 424, in call_api
2021-04-19 08:09:47,596 [20] [cmk.base.notify] Output: return self.__call_api(resource_path, method,
2021-04-19 08:09:47,596 [20] [cmk.base.notify] Output: File “/omd/sites/<OMD_SITE>/lib/python3/opsgenie_sdk/api_client.py”, line 219, in __call_api
2021-04-19 08:09:47,597 [20] [cmk.base.notify] Output: raise exception
2021-04-19 08:09:47,597 [20] [cmk.base.notify] Output: File “/omd/sites/<OMD_SITE>/lib/python3/opsgenie_sdk/api_client.py”, line 197, in __call_api
2021-04-19 08:09:47,597 [20] [cmk.base.notify] Output: response_data = self.retrying.call(fn=self.request, method=method, url=url,
2021-04-19 08:09:47,597 [20] [cmk.base.notify] Output: File “/omd/sites/<OMD_SITE>/lib/python3/tenacity/init.py”, line 411, in call
2021-04-19 08:09:47,597 [20] [cmk.base.notify] Output: return self.call(*args, **kwargs)
2021-04-19 08:09:47,597 [20] [cmk.base.notify] Output: File “/omd/sites/<OMD_SITE>/lib/python3/tenacity/init.py”, line 423, in call
2021-04-19 08:09:47,597 [20] [cmk.base.notify] Output: do = self.iter(retry_state=retry_state)
2021-04-19 08:09:47,597 [20] [cmk.base.notify] Output: File “/omd/sites/<OMD_SITE>/lib/python3/tenacity/init.py”, line 360, in iter
2021-04-19 08:09:47,597 [20] [cmk.base.notify] Output: return fut.result()
2021-04-19 08:09:47,598 [20] [cmk.base.notify] Output: File “/omd/sites/<OMD_SITE>/lib/python3.8/concurrent/futures/_base.py”, line 432, in result
2021-04-19 08:09:47,598 [20] [cmk.base.notify] Output: return self.__get_result()
2021-04-19 08:09:47,598 [20] [cmk.base.notify] Output: File “/omd/sites/<OMD_SITE>/lib/python3.8/concurrent/futures/_base.py”, line 388, in __get_result
2021-04-19 08:09:47,598 [20] [cmk.base.notify] Output: raise self._exception
2021-04-19 08:09:47,598 [20] [cmk.base.notify] Output: File “/omd/sites/<OMD_SITE>/lib/python3/tenacity/init.py”, line 426, in call
2021-04-19 08:09:47,598 [20] [cmk.base.notify] Output: result = fn(*args, **kwargs)
2021-04-19 08:09:47,598 [20] [cmk.base.notify] Output: File “/omd/sites/<OMD_SITE>/lib/python3/opsgenie_sdk/api_client.py”, line 468, in request
2021-04-19 08:09:47,598 [20] [cmk.base.notify] Output: return self.rest_client.POST(url,
2021-04-19 08:09:47,598 [20] [cmk.base.notify] Output: File “/omd/sites/<OMD_SITE>/lib/python3/opsgenie_sdk/rest.py”, line 307, in POST
2021-04-19 08:09:47,599 [20] [cmk.base.notify] Output: return self.request(“POST”, url,
2021-04-19 08:09:47,599 [20] [cmk.base.notify] Output: File “/omd/sites/<OMD_SITE>/lib/python3/opsgenie_sdk/rest.py”, line 240, in request
2021-04-19 08:09:47,599 [20] [cmk.base.notify] Output: data = self.decodeResponse(r.data)
2021-04-19 08:09:47,599 [20] [cmk.base.notify] Output: File “/omd/sites/<OMD_SITE>/lib/python3/opsgenie_sdk/rest.py”, line 336, in decodeResponse
2021-04-19 08:09:47,599 [20] [cmk.base.notify] Output: return json.loads(data)
2021-04-19 08:09:47,599 [20] [cmk.base.notify] Output: File “/omd/sites/<OMD_SITE>/lib/python3.8/json/init.py”, line 357, in loads
2021-04-19 08:09:47,599 [20] [cmk.base.notify] Output: return _default_decoder.decode(s)
2021-04-19 08:09:47,599 [20] [cmk.base.notify] Output: File “/omd/sites/<OMD_SITE>/lib/python3.8/json/decoder.py”, line 337, in decode
2021-04-19 08:09:47,599 [20] [cmk.base.notify] Output: obj, end = self.raw_decode(s, idx=_w(s, 0).end())
2021-04-19 08:09:47,600 [20] [cmk.base.notify] Output: File “/omd/sites/<OMD_SITE>/lib/python3.8/json/decoder.py”, line 355, in raw_decode
2021-04-19 08:09:47,600 [20] [cmk.base.notify] Output: raise JSONDecodeError(“Expecting value”, s, err.value) from None
2021-04-19 08:09:47,600 [20] [cmk.base.notify] Output: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2021-04-19 08:09:47,642 [20] [cmk.base.notify] Plugin exited with code 1

can you post a screenshot of your notification settings for opsgenie?
Setup → Notifications → “Edit this notification rule” → Section “Notification Method”

It isn’t a global notification rule, but user related. Settings in the screenshot are same which I am using as well for Checkmk 1.6.0p22

thanks for the screenshot. We will have a look

1 Like

I can not reproduce this with your settings (even within docker and configured as user notifcation rule).
Does this happen for all Host/Service notifications for this user?

I have created other environment. I am running docker container on the host within VirtualBox.
There I have created notification to Opsgenie under global notification, but with same result. Notification is falling as well.

There are affected different hosts/services. :frowning:

Note: We are using the “Rest API HTTPS over JSON” integration in the Opsgenie.

what’s the reason for not using the checkmk integration?

image

As I understood correctly the the Opsgenie integration for Check (2nd row on the screen) is is using API v1.

image

But plugin within Checkmk is for API v2.

We tested in the past as well scrip from Opsgenie (https://raw.githubusercontent.com/opsgenie/opsgenie-integration/master/check_mk/opsgenie). I was not satisfied :frowning: Is it works with Checkmk v2? I guess I tested it as well without successful.

Eventually what is better way to send notification to Opsgenie from Checkmk v2? Your hints or experience.
https://support.atlassian.com/opsgenie/docs/integrate-opsgenie-with-checkmk/
or
https://docs.checkmk.com/latest/en/notifications_opsgenie.html

At that moment I am satisfied with 1.6.0p22, but we are thinking about update to v2. Therefore I made some tests.

If you use the howto from our docs (using an api key of the checkmk integration), this should work fine with checkmk 2.0

Finally I found error. I had a typo in the domain settings :frowning: . Instead of https://api.eu.opsgenie.com there was https://app.eu.opsgenie.com.

1 Like

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.