How to Display Host Status in Grafana

Hi,

we have a site-to-site VPN connecting our local network with a remote network. In the local network we have a CheckMK server monitoring a host from the remote network. This is to see if the VPN is up.

I would like to display the UP/DOWN Host Status of this remote host in Grafana. We use CheckMK Enterprise and I’ve already installed the grafana-checkmk-datasource-1.1.0 to our Grafana. I can diplay “predefined graphs” and “single metrics” like CPU usage, but how do I display the Host Status?

In case it is not possible, how should I display a CheckMK monitored VPN link in Grafana?

Thank you,
Regards,
Oskar

If your remote host has a normal Ping check i would use the packet loss rate to make an Up/Down status inside Grafana. 0% loss = Up - 100% loss = Down values between are also Up :slight_smile:

Hi Andreas,

OK, l am going to use the Ping check’s packet loss metric. Thanks for the suggestion.

But that creates 2 new problems :slight_smile:

1.) The packet loss is 0% most of the time, CheckMK sends those zeros, but Grafana ignores them and shows “no data” instead

$ cat ping_packet_loss.sh 
#!/bin/bash

# SERVER, USERNAME, SECRET
source SECURE.sh

DATA='request={"specification":["template",{"site":"Monitoring","host_name":"pl-wro-gw","service_description":"PING","graph_index":1}],"data_range":{"time_range":[1605499244,1605520844]}}'
URL="https://$SERVER/Monitoring/check_mk/webapi.py?_username=$USERNAME&_secret=$SECRET&output_format=json&action=get_graph"

curl -X POST -d "$DATA" "$URL"

$ ./ping_packet_loss.sh 
{"result": {"step": 60, "start_time": 1605499200, "end_time": 1605520860, "curves": [{"color": "#ffc030", "title": "Packet loss", "line_type": "area", "rrddata": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]}]}, "result_code": 0}

2.) When I click on the Alert tab in Grafana I get “The datasource does not support alerting queries” message

I think both things are grafana specific, I am going to learn Grafana now…

Regards,
Oskar