Checkmk / grafana-checkmk-datasource

CheckMK data source for Grafana

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

can`t run the Datasource on Grafana v9.5.1 with "version": "3.0.0", "updated": "2023-04-06"

bh2005 opened this issue · comments

commented

Hi together,

i have put the new datasource on my grafana server but if i choice save/test i get the ERROR Message: undefined

and under explore there are no datas to select.

HowTo find out what happend ???

I have tried it with a CEE 2.1 and a 2.2 and different sites

grafana

check the network logs available via development console of your browser. you should see a request when clicking "save & test" which could show the source of the error. if this is not the case, check the grafana logs.

please tell us what the error is, so we can improve the error message in that situation.

commented

Hi Benedikt,

if i try to connect a CEE 2.2b5 site

to load resource: the server responded with a status of 410 (Gone) -> Message in Grafana: Could not read API response, make sure the URL you provided is correct..

https://XXXXXX/grafana/api/datasources/proxy/uid/cb701775-426a-4537-98b0-95f4052e633d/cmk/check_mk/webapi.py?action=get_combined_graph_identifications

POST /grafana/api/datasources/proxy/uid/cb701775-426a-4537-98b0-95f4052e633d/cmk/check_mk/webapi.py?action=get_combined_graph_identifications HTTP/1.1
Accept-Encoding: gzip, deflate, br
Accept-Language: de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7
Connection: keep-alive
Content-Length: 99
Cookie: grafana_session=930da610e99cf45d8befe1cbddf94402; grafana_session_expiry=1683175155; SAPWP_active=1; PortalAsyncReload=dXdsX3JlbG9hZD0xNjc0NjQzMjY2LGxhc3RfbG9naW49ZmFsc2UsY2hlY2tfcGFzc3dvcmQ9ZmFsc2UsbWFpbF9yZWxvYWQ9MTY3NDY0MzI2Nixwb3J0YWxfYXZhaWxhYmxlPXRydWUsY2F0ZWdvcmllc19zdG9yZWQ9ZmFsc2UsdXBkYXRlX2NhdGVnb3JpZXM9dHJ1ZSxzcGVlZHVwX3BvcnRhbD10cnVl; MYSAPSSO2=AjExMDAgAA5wb3J0YWw6S1M4NDU5N4gAB2RlZmF1bHQBAAdLUzg0NTk3AgADNDQ0AwADUEo0BAAMMjAyMzAxMjUxMDQxBQAEAAAADAoAB0tTODQ1OTf%2FAPgwgfUGCSqGSIb3DQEHAqCB5zCB5AIBATELMAkGBSsOAwIaBQAwCwYJKoZIhvcNAQcBMYHEMIHBAgEBMBYwDjEMMAoGA1UEAxMDUEo0AgRS3bYKMAkGBSsOAwIaBQCgXTAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0yMzAxMjUxMDQxMTJaMCMGCSqGSIb3DQEJBDEWBBSbOi7s2XJkJ!x%2Fp4VOqPdSKZK51TAJBgcqhkjOOAQDBC8wLQIVANmgdK6NOfgtIj9cda5l4xBtfLCyAhR6S8J60lv38GKsNxJ5FULrGOaWaw%3D%3D; ### ### auth_main=cmkadmin:1682684597.21:fb688a7e098f6b1f1ed311c4c7bdcddf
Host: XXX.com
Origin: https://XXX.com
Referer: https://XXX.com/grafana/datasources/edit/cb701775-426a-4537-98b0-95f4052e633d
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36
accept: application/json, text/plain, /
content-type: application/x-www-form-urlencoded
sec-ch-ua: "Chromium";v="112", "Google Chrome";v="112", "Not:A-Brand";v="99"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
x-grafana-nocache: true
x-grafana-org-id: 1

!!!! Why is in this request
auth_main=cmkadmin !!!!!

User is grafana

{"id":14,"uid":"cb701775-426a-4537-98b0-95f4052e633d","orgId":1,"name":"Checkmk","type":"tribe-29-checkmk-datasource","typeLogoUrl":"","access":"proxy","url":"","user":"","database":"","basicAuth":false,"basicAuthUser":"","withCredentials":false,"isDefault":false,"jsonData":{"edition":"CEE","url":"https://XXX.com/main","username":"grafana"},"secureJsonFields":{"secret":true},"version":27,"readOnly":false,"accessControl":{"alert.instances.external:read":true,"alert.instances.external:write":true,"alert.notifications.external:read":true,"alert.notifications.external:write":true,"alert.rules.external:read":true,"alert.rules.external:write":true,"datasources.id:read":true,"datasources:delete":true,"datasources:query":true,"datasources:read":true,"datasources:write":true}}

In this Case Grafana and the Site is running on the same Server

If i try to connect a CEE 2.1.p24 Site

running now .... after i have delete the grafana user in CMK and add a new one

by the way undefined in the screenshot was:
wrong PW

commented

with the THRUK datasource the connection works to 2.2

Are you sure you are using version 3.0.0 of the plugin? This should show a dropdown for the Version of Checkmk you are using, which is not visible in the screenshot.

The "410 Gone" error message could be an indicator for that: you are tying to use the old WEB-API with Checkmk 2.2.0 which no longer supports this WEB-API.

commented

I thing so ;)

`-rw-r--r-- 1 grafana grafana 3840 Apr 6 13:49 CHANGELOG.md
drwxr-xr-x 2 grafana grafana 4096 Apr 6 13:49 img
-rw-r--r-- 1 grafana grafana 15220 Apr 6 13:49 LICENSE
-rw-r--r-- 1 grafana grafana 82272 Apr 6 13:49 module.js
-rw-r--r-- 1 grafana grafana 149 Apr 6 13:49 module.js.LICENSE.txt
-rw-r--r-- 1 grafana grafana 157875 Apr 6 13:49 module.js.map
-rw-r--r-- 1 grafana grafana 1699 Apr 6 13:49 plugin.json
-rw-r--r-- 1 grafana grafana 1417 Apr 6 13:49 README.md
root@XXXXX:/var/lib/grafana/plugins/tribe-29-checkmk-datasource# cat CHANGELOG.md

Changelog

3.0.0

Highlights

  • Add support for REST API endpoints of Checkmk 2.2.0
  • Many UI improvements:
    • Clearer layout for both the RAW and CEE Query Editor
    • RAW filters are now displayed vertically aligned
    • The filter type of existing filters can no longer be changed, they have
      to be removed, and another filter can be added.
    • Errors in the Query Editor Fields are more prominently featured in the
      inputs themselves
  • Graphs in Grafana now show the same color as in Checkmk
    `

but You are right

"This should show a dropdown for the Version of Checkmk you are using, which is not visible in the screenshot."

I didn`t see a dropdown menue

commented

I had copy the zip again and now ;)

Data source is working, reached version 2.2.0b5.cee of checkmk

Excellent !!!

I don`t know why but the System had the old Datasource inside .... now everthing fine THX !!!