Is it possible to show live host status from checkmk on Grafana geomap?

Those are my hosts in CheckMK

I want the final result to look smth like that :

So if host is UP = GREEN DOWN = RED d marker
What would be the best approach to this.

doesn’t look like you can with geomap unless your data is coming as geojson in which case you can use Style config

Another way you can do it is by using Business Text plugin with leaflet js

  var circle = L.circle([lat, lon], {
    color: 'green',
    fillColor: '#00FF00',
    fillOpacity: 0.5,
    radius: 500
  }).addTo(map);
1 Like

Thank you for fast reply… now i am able to get data in grafana via my own API that transforms data to GJSON :


But now i am stuck on how to use style config to get the coordinates to the map.

I did this for checkmk:

In checkmk i added some additional labels for location name, latitude and longitude:

then I used the infinity datasource to query the checkmk rest api (test folder, you can query any folder):

http://xxxxxx:5001/xxxx/check_mk/view.py?filled_in=filter&host_regex=&neg_host_regex=&output_format=csv_export&site=xxx&view_name=allhosts&wato_folder=test&_username=automation&_secret=xxx

I used the csv export option in chekcmk as the json export is not proper json, and the column separator is a ;

I had to use a transformation, extract fields, on the host labels column, as they all come through in one set, to split up each label

Then I configured the data layer as follows:

This is to tell it which fields to use for latitude and longitude

then finally a value mapping to show the colour depending on up or down:

image

2 Likes


Is that the right path where i need to create labels ?

i created them directly on the hosts:

1 Like

the long and lat are not showing up in the csv table :


am i doing it right :

i tried removing and inserting commas before and after values but no change
thanks for help

sorry about that, I also customized my allhosts view to include the labels so it is visible to the api:

image

1 Like

share your panel when you get it working?

1 Like


Got it working, now in checkmk but cant pass the labels to grafana:

awesome stuff @sowdenraymond !!! Is the override for the color working on the geojson layer or on another layer? I cant seem to make it work on my map

I added a status layer for the host statuses:

can you post a snip of your allhosts view like this:

image


sorry for late reply

can you try making the view public?

1 Like

solved now i just need to extract fields… thanks

1 Like

even after changing the view to public i am unable to export labels as csv:


but i was able to do that exporting data as json and extrcted the fields:

but i am not able to select the lat and long field in the dropdown menu:

add a transform to convert those two fields to numeric

2 Likes

you can also add a filter data by values transform to filter out the top column that shows the headings if necessary

1 Like

got it working :


now just need to do some enhancements… Thanky you @sowdenraymond your the best :sunny:

1 Like