Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Data sources can be downloaded from: https://github.com/tribe29/grafana-checkmk-datasource/releases


Table of Contents

Web vs. Rest API

Checkmk version 2.1 and below use the Web API while 2.2 and greater uses REST API.

...

If testing the Web API via Grafana is needed, you will first want to open the Network Analyze with your internet browser. We can test the Web API using Curl, but we will need to must form the API request first.

...

...

  1. Click on "Network" within the top bar
  2. Click on "Save & Test" on the Grafana Data Source page
  3. Select the "webapi.py" response on the left sidebar of the Inspector page
  4. Click on "Headers" on the response bar
  5. Copy the "Request URL" line to your text editor so adjustments can be made. Copy everything from HTTP:// through webapi.py?
    1. ie: i.e., "http://localhost:3000/api/datasources/proxy/uid/BZ7iqAa4z/cmk/check_mk/webapi.py?"
    2. This provides us with the Unique ID "BZ7iqAa4z" which will be different differ on every installation. 




  • To form your API request, you will need several pieces of information that will be required.
    1. Grafana Username & Password
    2. URL Copied from Internet Inspector
    3. Checkmk Automation User & Password
    4. API commands for the information that you are trying to query
      1. Checkmk Web API Reference Guide

In the following example, we will make request an API request to list all of the known hosts currently added to our Checkmk instance.

...

If testing the Web API via Grafana is needed, you will first want to open the Network Analyze with your internet browser. We can test the Web API using Curl, but we will need to must form the API request first.

...

...

  1. Click on "Network" within the top bar
  2. Click on "Save & Test" on the Grafana Data Source page
  3. Select the "Version" response on the left sidebar of the Inspector page
  4. Click on "Headers" on the response bar
  5. Copy the "Request URL" line to your text editor so adjustments can be made. Copy everything from HTTP:// through /1.0/
    1. ie: i.e., "http://localhost:3000/api/datasources/proxy/uid/BZ7iqAa4z/rest/check_mk/api/1.0/"
    2. This provides us with the Unique ID "BZ7iqAa4z" which will be different differ on every installation. 




  • To form your API request, you will need several pieces of information that will be required.
    1. Grafana Username & Password
    2. URL Copied from Internet Inspector
    3. API commands for the information that you are trying to query
      1. Checkmk REST API Reference Guide

In the following example, we will make request an API request to list all of the known hosts currently added to our Checkmk instance.

...

  • To break this command down, we used the following:
    1. Grafana Username & Password
      • username:password
    2. URL Copied from Internet Inspector
      • @localhost:3000/api/datasources/proxy/uid/BZ7iqAa4z/rest/check_mk/api/1.0/
    3. API Action or Command
      • domain-types/host_config/collections/all?effective_attributes=false' 
    4. API Output 
      • -H 'accept: application/json'

...

If you have no SSL certificates installed, you will want to review the Securing the web Web interface with HTTPS document to create and install your certificates.