Giter Club home page Giter Club logo

grafana-checkmk-datasource's Introduction

Checkmk - Your complete IT monitoring solution

PR-CI status

Checkmk is available in several editions. The Checkmk Raw Edition is free and 100% open-source. The Checkmk Enterprise Edition includes several additional features and professional support from the authors, billed annually. A demo version is freely available for testing the Enterprise Edition.

Checkmk can be installed on Linux servers via DEB and RPM packages found on our downloads page. The Enterprise Edition is also available as a virtual or physical appliance. The following short installation guides show how you can easily set up Checkmk and begin monitoring.

Please visit our website for more details.

Getting started

Please have a look at the beginners guide on how to get started with Checkmk.

Want to contribute?

Nice! Before contributing please check out our contribution guidelines.

Building on your own packages

It is highly recommended to use the prebuilt Checkmk packages we provide. But if you really want to build your own packages, you either need to download the source packages from our website or check out the Git repository.

We're building the Checkmk packages within specific docker images for the different distros. Please find the Dockerfiles under buildscripts/infrastructure/build-nodes/ in order to get an idea what's needed to build it locally. However, keep in mind that those Dockerfiles are heavily relying on our infrastructure and won't build from scratch on your machine.

If you have the dependencies in place, you can either create RPM or DEB packages, depending on your Linux distribution.

To build an RPM:

make rpm

To create a DEB package:

DEBFULLNAME="Mr. Buildmaster" DEBEMAIL="[email protected]" make deb

Don't forget to insert your name and mail address. As a result you should find packages of the form check-mk-[edition]-[version].[deb|rpm] in your current directory.

grafana-checkmk-datasource's People

Contributors

benediktseidl avatar englertor avatar godspeed-you avatar lpetrora avatar matteostifano avatar ruohki avatar thespacycat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grafana-checkmk-datasource's Issues

Improve handling of CORS issues

In case I configure a site with an old Check_MK version that has missing CORS settings I get this message in the GUI:

Could not read API response, make sure the URL you provided is correct.

The browser console shows this message:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost/heute/check_mk/webapi.py?_username=undefined&_secret=undefined&output_format=json&action=get_all_hosts. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

Is it possible to detect this specific situation (CORS header issue) and print out another error message?

Something like: Invalid URL or Check_MK version. You need to use at least Check_MK 1.5.0p16.

Panel editor: Improve error reporting when API calls fail

In case an API call fails it reports back a structure like this:

{"result": "Check_MK exception: Currently not supported with this Check_MK Edition", "result_code": 1}

Can we show the error messages of the result_code=1 responses to the use in the panel editor?

Hostname in title (RAW edition)

When using the plugin with the RAW edition, before plugin version 2.0 I could use multiple queries on different hosts in a single graph. Now, all data frames have the same name (e.g. "Input bandwidth" and "Output bandwidth", each repeated once for every host).

I hacked around this using the following:

--- a/src/DataSource.ts
+++ b/src/DataSource.ts
@@ -24,7 +24,7 @@ function buildMetricDataFrame(response: any, query: MyQuery) {
   const frame = new MutableDataFrame({
     refId: query.refId,
     fields: [{ name: 'Time', type: FieldType.time }].concat(
-      curves.map((x: any) => ({ name: x.title, type: FieldType.number }))
+      curves.map((x: any) => ({ name: get(query, "context.host.host") + "," + x.title, type: FieldType.number }))
     ),
   });
   zip(...curves.map((x: any) => x.rrddata)).forEach((d: any, i: number) =>

However, this most definitely isn't a proper solution, because it will probably break Enterprise Editions.

refactor dropdowns: adapt to current 2.1.0 and master

there was some refactoring regarding the auto completion: Checkmk/checkmk@684d04f
we probably have to adapt to these changes...

  • raw edition: request={"ident":"available_graphs","params":{"strict":"withSource","context":{"siteopt":{"site":"cmk210d"},"host":{"host":"internal"}}},"value":""} -> withSource needs to be replaced

Allow to scrape views and present them in tables

In addition to graphs and single metrics, it would be good if this datasource also offers the possibility to retrieve views and display them in a table.

Example: To show services with issues on a dashboard, I would like to create specific views with filters in Check_MK and present them in Grafana via the table visualization panel. We are currently implementing this using iFrames, which are unfortunately very inflexible.

Wrong version in error message

Error message includes a wrong version number:

API request was cancelled. This has either happened because no 'Access-Control-Allow-Origin' header is present, or because of a ssl protocol error. Make sure you are running at least Check_MK version 15.0p16.

This should be "1.5.0p16".

Grafana "Service" field is missing on GUI

Testing check_mk Check_MK 1.6.0-2019.07.15 Enterprise. Your latest grafana-checkmk-datasource (16July2019). Grafana 6.2.5.
In the Query menu, most fields operate OK including Mode,Site,Host. But "Service" field is inaccessible.

Concept: Dynamic collection of metrics

As user of the checkMK Grafana datasource I want to create graphs that select the available metrics dynamically.

Acceptance:

  • We have a concept for graphs with a dynamic number of metrics
  • This concept allows use cases like this:
    • Show a summarized metric of the CPU load of all hosts with the label os:linux
    • Show all Disk IO read / write metrics of all hosts matching the regex ".*prod$" as lines

Can't load the metric

Hi

I am evaluating for a monitoring tool and the check_mk in combination with Grafana (check_mk plugin for Grafana) looks very good, but I have a problem.
I have add the plugging to Grafana but it cannot display anything, it is going till mode, I do not have any metric to select.
I am doing something wrong, can you help me on this?

image

BR
Mela

API error

Hi everybody,
i have the trouble that i try to use the check_mk plugin for my check_mk core.
i have version 2.0.9.
the url is the right one i try to download the api .py via wget and that worked.
but if i setup via grafana check_mk plugin i get the following error after safe and test:
"Could not read API response, make sure the URL you provided is correct."
And its not usable.
can someone help me out?
thanks and kind regards
matze

Not able to connect RAW instance

Hi,

today I checked out this plugin (e59e5b0). I integrated it into an existing Grafana (8.4.4) which is running as a Docker container.

I try to connect it to a Checkmk RAW test instance running also within Docker (Checkmk Raw Edition 2.1.0-2022.03.31) and this is what I get:

Checkmk exception: Currently not supported with this Checkmk Edition
Traceback (most recent call last): File "/omd/sites/cmk/lib/python3/cmk/gui/plugins/webapi/grafana.py",
line 118, in _get_combined_graph_identifications from cmk.gui.cee.plugins.metrics.graphs
import ( ModuleNotFoundError: No module named 'cmk.gui.cee' During handling of
the above exception, another exception occurred: Traceback (most recent call
last):
File "/omd/sites/cmk/lib/python3/cmk/gui/webapi.py", line 116, in page_api resp = _execute_action(api_call, request_object)
File "/omd/sites/cmk/lib/python3/cmk/gui/webapi.py", line 207, in _execute_action return _execute_action_no_lock(api_call, request_object)
File "/omd/sites/cmk/lib/python3/cmk/gui/webapi.py", line 221, in _execute_action_no_lock "result": api_call["handler"](request_object),
File "/omd/sites/cmk/lib/python3/cmk/gui/plugins/webapi/grafana.py", line 123, in _get_combined_graph_identifications raise
MKGeneralException(_("Currently not supported with this Checkmk Edition")) cmk.utils.exceptions.MKGeneralException:
Currently not supported with this Checkmk Edition

According to the docs: „Beginning with version 2.0.0, it is possible in all Checkmk editions to directly address Checkmk as a data source in Grafana“ which in my understanding includes RAW – at least it wouldn't make sense to offer a dropdown containing „RAW“ and „Enterprise“ when RAW won't work.

So please help me: what am I missing?

Regards,
Marianne

Bug: Zero (0) values not displayed correctly

Abstract

Zero values (0) will not result in a data point in grafana. The graph will falsely display the last received value greater than zero.
0-value
In CheckMK the graph displays the 0 value correctly.

Steps to reproduce

  • Add CheckMK Check which will could have 0 values (e.g. using fileinfo.groups to count files in a directory, it could be a valid case that the directory is empty)
  • Add grafana table panel and use this newly created checkmk service check as datasource
  • Grafana only displays rows having value greater than 0

Versions

  • Grafana 6.5.2
    -- CheckMK Plugin 1.1.0
  • CheckMK 1.6.0p7 Enterprise

null value and lines connections

hello,

"Connect null values" option in Grafana panel settings, won't work if there is no data pulled from the check_mk source. At the end, all points are connected.
like on this graf. Query interval is on 60s like in check_mk (enterprice version).

Tested also the Connect null values/Threshold with <2m settings and nothing has changed

image

image

the goal is to have such graf
image

Is it possible to go around with such a problem?
Maybe I missed some settings?

Grafana v8.0.4 (81fef5b4b4)
Checkmk enterprice 1.6.0p19

Marcin

Improve switch from "predefined graph" to "single metric"

When having selected one "predefined graph" in a query and then changing to "single metric" the previous graph rendering should vanish immediately. At the moment the "predefined graph" metrics are removed once a metric is selected.

Make parts of the monitoring history available via annotations

As user of checkMK+Grafana I want to be able to make events from the monitoring history available to the viewer of graphs.

Acceptance:

Background:

The monitoring history of checkMK contains state changes, acknowledgements, downtime information and information about notifications. Using the raw history information would be too verbose for Grafana, but based on these information checkMK calculates availability analysis for hosts and services. It could be very useful to make this kind of information available in grafana.

Details about the availability feature can be found here: https://mathias-kettner.com/cms_availability.html

docker image don't work

I tried to use the docker image for 1.6.0p2 as CEE and CRE.
Both images don't work properly. I get the following error with

docker run -d -p 8080:50000 checkmk/check-mk-enterprise:1.6.0p2
docker: Error response from daemon: No command specified.
See 'docker run --help'.

Metric on Graph Settings hidden.

Hi there:
I'm testing the last CheckMK version (1.6.0p10) and 7.2.0 Grafana version. I installed within grafana the plugin and the connection was correct, so, adding a new dashboard, new panel, into the query, I can add everything that I need but Metric, under Service.
Clicking in this field doesn't appear the Metric, and if I config it manually, it doesn't work too. I can't take any value of the hosts.

What can be the mistake?
Thanks in advance! :)

Support for Variables

It would be nice if you can use variables in the provided fields eg. host. So it is possible to create dynamic dashboards with rows.

image

Data may be misaligned

I have set up graphs comparing the Check_MK datasource and the Check_MK via InfluxDB.
Unfortunately they give different results and I believe InfluxDB is correct.
Specifically, you can see this on the Grafana GUI by going Visualisation-> Value->Stat=Current.

But I am sure it is showing Average and not Current at all.
Using software versions;

  • Grafana6.1.6
  • Check_MK Enterprise 1.5.0p16
  • Your Grafana-Datasource 1.01

Problem appears to show it self very easily with CPU utilisation.. for example

Concept: Use full graph definitions from checkMK metric system

As user of the Grafana checkMK datasource I want to be able to add the predefined graphs to my Grafana dashboard.

Acceptance:

  • We have a rough concept how the graph definitions (units, scaling) from checkMK can be transported to Grafana
  • The transported information is not persited within Grafana. Changes between checkMK updates are applied to Grafana.

Some background information about the checkMK graphing logic:

Each service that has metrics may have a dynamic number of graphs in the checkMK graphing system. The graphs are created based on the the collection of metrics and defined graphs in Check_MK. Most standard graphs are defined in https://github.com/tribe29/checkMK/blob/master/cmk/gui/plugins/metrics/check_mk.py.

When the graphs of a service are requested by a user the check_mk graphing system takes the metrics of the service as input and searches all entries in "graph_info". Each graph_info entry that can be fully populated with the available metrics is rendered for this service.

Example: A service has a metric fan_speed=3200. The graph_info["fan_speed"] entry only requires the "fan_speed" metric to be available. This graph can then be rendered. The metrics list also tells the graph how to draw the different metrics (e.g. as lines or stacked)

Another important structure is the metric_info. It holds entries for each metrics to tell the graphing system which units or colors to use for the single metrics.

The precomputed information can be fetched from the checkMK metric system using the available API calls.

Unknown Plugin Data Source Error

Hello,

I have the plugin installed and when trying to configure the plugin in grafana, I get the following error:

Unknown Plugin Data Source Error

I am using the following software versions

Debian 11.2
Check_mk: check-mk-raw-2.0.0p21
Grafana: grafana oos 8.4.4

The logs of grafana:

tail -f /var/log/grafana/grafana.log
logger=context t=2022-03-18T10:54:11.64-0300 lvl=eror msg="Could not find plugin definition for data source" datasource_type=tribe-29-checkmk-datasource
logger=context t=2022-03-18T10:54:12.32-0300 lvl=info msg="Request Completed" method=GET path=/api/live/ws status=0 remote_addr=... time_ms=7 size=0 referer=
logger=context t=2022-03-18T10:54:29.16-0300 lvl=eror msg="Request Completed" method=GET path=/api/gnet/plugins status=502 remote_addr=** time_ms=2 size=0 referer="http://...:3000/datasources/new?utm_source=grafana_gettingstarted"
logger=context t=2022-03-18T10:54:42.31-0300 lvl=info msg="Request Completed" method=GET path=/api/plugins/tribe-29-checkmk-datasource/settings status=404 remote_addr=*** time_ms=0 size=64 referer=http://:3000/datasources/edit/mMu4e2E7k
logger=context t=2022-03-18T10:54:54.92-0300 lvl=info msg="Request Completed" method=GET path=/api/plugins/tribe-29-checkmk-datasource/settings status=404 remote_addr=
time_ms=0 size=64 referer=http://***:3000/datasources/edit/mMu4e2E7k

I will appreciate if you can help me

Regards

Individual Time RRD-Steps is not possible

Actually Grafana set the "Step" Value depends on the timerange, for example a timerange from 405minutes gives a step = 60 back.
A range from 406 minutes gives a step = 120 back.

The Bad effect is: The graph is less detailed over a bigger timerange and for some cases it's necessary to see the little "peaks" for example in 24 hours.

The Query Inspector give me this as result:

405 min relative time:

response:Object
result:Object
step:60
start_time:1574320140
end_time:1574344440
curves:Array[3]

407min relative time:

response:Object
result:Object
step:120
start_time:1574320080
end_time:1574344560
curves:Array[2]

What i Expected:

Check_MK RRD is saving 1 min steps for 2880 points. (default)

So it should possible to used this points in Grafana.

Rename Series

It's not possible to rename a series, so for instance, adding CPU Utilization from multiple servers or hosts lists each series as "CPU Utilization" with no way to differentiate between them.

image

Add quick test setup guide to readme

Possible contents:

  1. Download & setup check_mk container like this: TODO
  2. Open Check_MK GUI
  3. Add a single host to Check_MK and discover the services
  4. Get automation user credentials: WATO > Users > automation
  5. Checkout grafana-checkmk-datasource to e.g. /home/lm/git/grafana-checkmk-datasource
  6. Start grafana like this: docker run -d -p 3000:3000 -v /home/lm/git/grafana-checkmk-datasource/dist:/var/lib/grafana/plugins/checkmk-datasource grafana/grafana
  7. Login to Grafana with admin:admin: http://localhost:3000/
  8. Configure Check_MK data source (Insert URL and credentials)
  9. Configure first graph

Extract Host/Service Status [CRIT/WARN/OK]

We need to be able to count / graph devices in CRIT state against a total count of devices. There is no way to display/represent the status of a device, only to graph metrics.

[Feature Request] Global Informations

A bit more overview informations would be awesome.

like 10/440 Hosts in critical state
array of critical hosts
array of warning hosts
anmount of hosts
anmount of services
how much warning state
which warning states and so on

CheckMK - Grafana - Process Discovery

Hi,

I have been using CheckMK and the corresponding CheckMK-Grafana Plugin for visualizing a sort of Network/Host Monitoring. And now i ran into a problem.

I’ve added the checks for some processes on our Windows Server 2019 machines. While the processes are running everything works as expected and i can visualize the Check in Grafana. (Green for process is running). Once the process is not running, i would assume that the check would go red, since there is no process running but grafana throws an exception that it “cannot read property “meta” of undefined”.

i tried the enforced service and it is working more consistently, but there is still 1 problem.

If the process is running and you select the metric within Grafana, the number of processes is at position 5 or so within the possible metrics. If the process is not running there is only 1 metric left and so Grafana can not find the 5th metric within the service and and therefore throws another exception. “e is undefined”.

We’re running on CheckMK-Raw-2.0.0p7.

Kind Regards
Kai Jakobsen

Host filter is always a regular expression?

Using a regex in Host filter seems to be not optional and not working at all.
Steps to reproduce:

  • Add a Panel and select combined graphs
  • Activate regex for Host filter and add the beginning of a host name that matches to at least two hosts (e.g. myHost for 'myHost1' and 'myHost2')
  • configure the rest of the stuff and save the Panel - it should work as expected
  • Go back to the panel, deactivate regex and select the host directly
  • The Panel still shows the metrics for the regular expression.

If you reproduce the steps by not adding a regular expression first, you will not be able to select any graph to show. -> The selection is simply not used.

Plugin for Grafana Cloud in the official community catalog

Hi,

we're using Grafana Cloud as service and want to configure our check_mk as data source.

Grafana Cloud installs plugins through the public catalog rather than installing from a .zip or GitHub clone, so I currently do not see any way to have them work together.

Would it be possible for you to make the plugin available in the Grafana catalog? According to them, everyone in the community can offer their plugin through https://github.com/grafana/grafana-plugin-repository.

Thanks!

Datasource not offering any Site/Hosts/Services

Our installation:

  • CheckMK Enterprise in Version 1.6.0p11
  • Grafana v7.3.1
  • CheckMK Plugin v1.1.0

Grafana is running via docker:

docker run \
 -d \
 -p 8443:3000 \
 --name grafana \
 --restart always \
 --env "GF_AUTH_ANONYMOUS_ENABLED=true" \
 --env "GF_INSTALL_PLUGINS=https://github.com/tribe29/grafana-checkmk-datasource/archive/1.1.0.zip;checkmk-datasource" \
 --env "GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=checkmk-datasource" \
 -v /opt/grafana_data:/var/lib/grafana \
 grafana/grafana

When configuring the plugin, it is shown with a red "unsigned"-badge. Aside from that it accepts my credentials for CheckMK and shows Datasource is working when saving.

However, when creating a new panel there are no sites, hosts or services being offered after selecting "CheckMK" as datasource. The CheckMK user for the login had access to around 8-9 machines before switching to an automation password.

Update: This is a permission issue. When using an administrator account, the Hosts become selectable. There is no mention of any required permissions as far as I can see. What permissions are needed?

Creating complex graphs in Grafana - CMK raw

Hi, I'm using Grafana with CheckMK Raw 2.0.0p6 and I haven't had any luck when it comes to complex graphs, it doesn't seem like I am the only one: https://forum.checkmk.com/t/checkmk-raw-with-grafana-combined-graph-graph-field-not-selectable/25181/14

The graph preview always seems to stay empty even though I have multiple weeks worth of data on my checkmk server, everything else seems to work, including predefined graphs and single metrics.

In case it might be useful, whatever combination of host and service regex I use, the graph field seems to stay empty. Is there something I'm forgetting or does it work for anyone else?
image

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.