The official Checkmk datasource plugin for Grafana works well once it is configured right.
Two things get in the way. Its real request-body shape is not documented anywhere you can reach from Grafana's own API docs. And one settings field defaults to a value that silently breaks every graph on a free Checkmk install.
Fix. Open the datasource settings. Set Edition to Community Edition, or whichever matches your install. Save and Test.
If every panel fails identically no matter which host or service it targets, check this field first.
This plugin is frontend-only JavaScript with no backend binary. Its request format is not discoverable through Grafana's normal datasource API docs.
Recovering it took reading the plugin's minified source and capturing a real request in a browser network inspector. A panel target looks like this.
{
"refId": "A",
"datasource": {"type": "checkmk-cloud-datasource", "uid": "<datasource-uid>"},
"requestSpec": {
"site": "monitoring",
"host_name": "<host>",
"service": "<service description>",
"graph_type": "predefined_graph",
"graph": "<graph-id, resolved separately>",
"aggregation": "off"
}
}
graph_type can also be "single_metric". That needs a metric ID instead of a
graph ID, resolved through a different autocomplete endpoint than the one below.
Graph IDs are not predictable from a service name. They are not portable across hosts either, even for identically named services.
The same "CPU utilization" service resolves to a different internal graph ID depending on whether the check underneath is SNMP or agent-level.
So resolve it per host and service pair, every time, through Checkmk's own REST API. Not through Grafana's datasource proxy.
curl -s -X POST "http://<checkmk-host>/<site>/check_mk/api/1.0/objects/autocomplete/available_graphs" \
-H "Authorization: Bearer automation <secret>" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"value":"","parameters":{"strict":true,"show_independent_of_context":false,
"context":{"siteopt":{"site":"monitoring"},"host":{"host":"<host>"},
"service":{"service":"<service>"}}}}'
parameters, not
params. context nests inside parameters, not alongside
value. Host, service and site are each wrapped in their own single-key object, so
{"host": {"host": "..."}} and not a bare string.
Accept: application/json explicitly. Some HTTP clients do not send it, and without
it this Checkmk version returns a bare 406 even when the body is correct.
Clicking through Grafana's panel editor once per series is slow and error-prone past a handful of panels.
Build the whole dashboard JSON client-side instead. Every panel, every target, one structure. Then create it in a single call.
POST /api/dashboards/db
Set a fixed "uid" in that payload. Do not let Grafana generate one.
With a fixed UID, re-running the creation script updates the dashboard instead of creating a duplicate.