grafana-checkmk-datasource icon indicating copy to clipboard operation
grafana-checkmk-datasource copied to clipboard

Grafana cannot detect hosts from Checkmk

Open babsdn opened this issue 2 years ago • 7 comments

I have installed grafana v9.3.2 and checkmk raw edition but according to attach pic grafana cannot detect any host or service from checkmk . What is the issue ? How can solve it ?

check11

babsdn avatar Dec 22 '22 10:12 babsdn

Also I have added checkmk with grafana user not cmkadmin

babsdn avatar Dec 22 '22 10:12 babsdn

We will need more context here:

  • what checkmk version do you use?
  • are there suspicious entries in var/log/apache/access_log of your site?
  • are there suspicious entries in the grafana log?
  • are there any errors in the development console of your browser?

for debugging purpose it would also be a good idea to use the automation user, so we can rule out any permission problems, as this user has admin permissions.

BenediktSeidl avatar Dec 22 '22 13:12 BenediktSeidl

@babsdn Having the same issue.

  • checkmk raw version 2.1.0p15
  • the access_log looks good for me. "POST /site/check_mk/ajax_vs_autocomplete.py?_secret=*&_username=grafana&output_format=json HTTP/1.1" 200 970 "-" "Grafana/9.3.2"
  • using the automation user fixes the problem. Maybe there are some permission issues?

Semetra22 avatar Jan 02 '23 13:01 Semetra22

It indeed seems to be a permission issue, giving my grafana user administrator rights solved the problem for me, so the use of the automation user isn't necesssary.

clavis-420 avatar Jan 22 '23 10:01 clavis-420

My solution was to clone the user role to create a seperate grafana role and give that role the See all host and services permission. After assigning that role to the grafana user everything worked fine for me, so far. That might be the preferable solution for anyone who doesn't want to grant full admin rights to the grafana user.

michael-r-elp avatar Jan 30 '23 19:01 michael-r-elp

Had same issue and did the same thing. Thank you.

acopernic avatar Feb 16 '23 18:02 acopernic

Hello and thank you very much. This is not an issue but a permission problem. The built-in role "user" does not have the permission "See all host and services". This can be validated here: Setup > Users > Roles & permissions > Permission matrix

Solution:

  • Navigate to: Setup > Users > Roles & permissions
  • It is not possible to create a new role (from scratch). You have to clone an existing role (user).
  • Afterward you can rename the cloned role e.g. to grafana
  • Edit role grafana, search for "See all host and services" and change the value from "default (no)" to "yes".
  • Navigate to "Setup > Users" and assign this role to the Grafana-Automation-user
  • Do not forget to commit changes in Check MK

Suggestion: Add the notes into README.md and close the issue.

filipnet avatar Mar 04 '23 06:03 filipnet