This is a Grafana datasource for Checkmk metrics.
Minimal Checkmk Version is 1.6.0p2
. The Grafana datsource requires the Checkmk Enterprise Edition or Checkmk Managed Services Edition.
URL of the Checkmk Server used.
Example: http://checkmk.server/site/
User to be used for API calls. In most cases this will be 'automation'.
Secret for the API User. Save & Test will check if the User can be authenticated.
You can switch between modes for querying predefined graphs, single metrics or a combined graph where you can filter hosts and services by using a Regex.
This will default to 'all sites', but can be overwritten by simply entering any site.
The default label format '$title' can be changed to any static title or use the following placeholders: '$title', '$site', '$host', '$service'
You will be able to select a host from the automatically generated list. When using 'combined graph' mode you can also enter a regex to be applied.
You will be able to select a service from the automatically generated list. When using 'combined graph' mode you have to enter a regex as services between hosts can be different.
When using 'combined graph' mode you can also filter by Tags.
Only one series will be displayed.
One series might be displayed, depending on the selected graph
You can choose between different aggregation types to combine the results of the chosen filters.
This section is only relevant if you intend to modify this plugin.
In order to build this plugin you need npm and yarn installed on your machine.
First install dependencies:
yarn install
Then execute a build:
yarn run build
On building, the code will be automatically be linted, transpiled and moved to dist/
.
The following guideline can be used to setup a Checkmk & Grafana development environment. It used docker to run Checkmk and grafana.
Using image checkmk/check-mk-enterprise:1.6.0p2
:
docker run -d -p 8080:50000 checkmk/check-mk-enterprise:1.6.0p2
Make sure to note the password for cmkadmin
.
Next open the Checkmk GUI and login with the cmkadmin
user.
Add a host and discover some services, in order to be able to request some data later.
You will also need to get the automation user credentials under WATO > Users > automation
.
First checkout the grafana datasource repository to some local folder.
Using image grafana/grafana
:
docker run -d -p 3000:3000 -v /local/path/to/grafana-checkmk-datasource/dist:/var/lib/grafana/plugins/checkmk-datasource grafana/grafana
This will directly link the dist/
folder into grafana, and a simple rebuild will update the plugin, as it is evaluated at grafana runtime.
Login to Grafana with admin:admin
at http://localhost:3000/
Configure the Checkmk datasource by using http://localhost:8080/cmk/
as URL, and the automation user for authentication.
Add a Dashboard and configure your first graph using Checkmk as datasource.
For more grafana specific information please refer to https://grafana.com/docs/plugins/developing/datasources/