Skip to content

Commit d622b6e

Browse files
author
Óscar Nájera
committed
Release 2.0b1
1 parent 8aa6c7b commit d622b6e

File tree

13 files changed

+307
-76
lines changed

13 files changed

+307
-76
lines changed

README.md

Lines changed: 78 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,74 @@
1-
# Checkmk Grafana Data Source Plugin
1+
# Checkmk's Grafana Data Source Plugin
22

33
![CI](https://github.com/tribe29/grafana-checkmk-datasource/actions/workflows/node.js.yml/badge.svg)
44

5-
This Data Source allows you to query checkmk metrics. It is a complete rewrite
6-
of the previous connector to match newer grafana versions. This plugin is on
7-
the alpha testing stage.
5+
This data-source plugin is a complete rewrite from the previous connector. It has
6+
undergone a new architectural design and is not backwards compatible to the
7+
previous version. We nevertheless provide an upgrade procedure to assist you on
8+
the transition.
89

9-
Due to the breaking changes in this plugin, it is a complete separate plugin. We
10-
provide an update utility, although not all features from the previous connector
11-
are available. Those are some single metrics and annotations.
12-
13-
This plugin id is: `tribe-29-grafana-checkmk-datasource`
10+
This project has entered the Beta testing phase.
1411

1512
## Requirements
1613

17-
You require checkmk nightly build from the master branch and 7.0<=Grafana<8.2
14+
- Checkmk >= 2.0.0p20
15+
- Grafana >= 7.0
1816

19-
Since Grafana 8.2, plugins loaded diffently and the connector fails to load.
20-
Please help us with your setup on Issue #52 for us to debug further. We know
21-
that Grafana 8.3.4 on a docker container has worked for us, yet we don't yet
22-
know why.
17+
This plugin release accompanies the Checkmk 2.1 release. You can use it already
18+
with Checkmk 2.0.0p20 for testing purposes, however bug-fixes, changes and
19+
updates will mainly take place on Checkmk 2.1 to not compromise the stability
20+
of Checkmk 2.0.
2321

2422
## Getting started
23+
### Installation
2524

26-
### Building the plugin
27-
28-
1. Install dependencies
29-
30-
```BASH
31-
yarn install
32-
```
33-
34-
2. Build plugin in development mode or run in watch mode
35-
36-
```BASH
37-
yarn dev
38-
```
39-
40-
or
41-
42-
```BASH
43-
yarn watch
44-
```
45-
46-
3. Build plugin in production mode
25+
Download the released version of this repository or clone it. Released versions
26+
include the built artifacts, for non-releases you need to build the plugin
27+
yourself as explained further on this guide.
4728

48-
```BASH
49-
yarn build
50-
```
51-
52-
### Installing
53-
54-
For development it is easiest to create a symlink inside your grafana plugins
29+
This plugin's id is: `tribe-29-checkmk-datasource`
30+
For development it is easiest to create a symlink inside your Grafana plugins
5531
path(`/var/lib/grafana/plugins`) to this repository. Or if using docker mount
5632
this repository as a volume.
5733

58-
This plugin is not yet signed, thus you need to allow it on the `grafana.ini` file under
59-
`allow_loading_unsigned_plugins=tribe-29-grafana-checkmk-datasource`
60-
61-
Grafana will read the `dist` folder, this repository does not include the
62-
builds. You need to follow previous section to prepare your own builds.
63-
64-
### Plugin configuration
34+
This plugin is not signed, thus you need to allow it on the `grafana.ini` file under
35+
`allow_loading_unsigned_plugins=tribe-29-checkmk-datasource`
6536

66-
#### URL:
37+
Beware that starting Grafana>=8.2 the systemd start script changed permissions
38+
and you need to make sure this plugin is readable under those conditions. [Issue
39+
#52](https://github.com/tribe29/grafana-checkmk-datasource/issues/52#issuecomment-1026917446)
40+
includes troubleshooting information.
6741

68-
URL of the Checkmk Server used.\
69-
Example: http://checkmk.server/site/
7042

71-
#### Username:
43+
### Plugin configuration
44+
URL
45+
: URL of the Checkmk Server used.
46+
: Example: http://checkmk.server/site/
7247

73-
User for API calls. Don't use `automation`, because that user has also
74-
admin configuration rights. Use a dedicated user that can only monitor.
48+
Edition
49+
: Your checkmk edition
50+
: The connector will validate against the checkmk server your selection.
7551

76-
#### API Key:
52+
Username
53+
: User for API calls.
54+
: Don't use `automation`, because that user has also admin configuration rights.
55+
Use a dedicated user that has only monitoring permissions.
7756

78-
Secret for the API User. This key is not transmitted from the grafana UI, only
79-
the backend has access to it. This is a security improvement to the previous
80-
plugin.
57+
Secret
58+
: Secret for the API User.
59+
: This key is not transmitted from the Grafana UI, only the back-end has access
60+
to it. This is a security improvement over the previous plugin.
8161

8262
Save & Test will check if the User authenticates and the data source is
8363
reachable.
8464

8565
## Current state
8666

87-
- Service graph works on RAW & CEE
88-
- Single metric for the moment now works only on CEE
89-
- Combined graphs remains CEE only
90-
- Dropped "Label Format" option. Prefer Grafana overrrides.
91-
- Annotations are not usable yet
67+
- CEE configuration is now a filter based selection of graph templates of single metric.
68+
- RAW configuration offers Service graphs and some single metrics.
69+
70+
- Dropped "Label Format" option. Prefer Grafana overrides.
71+
- Annotations are not available.
9272

9373
### Combined graphs
9474

@@ -113,8 +93,8 @@ reachable.
11393

11494
## Updating from the previous connector
11595

116-
We provide a Python script `utils/converter.py` which will update the Grafana
117-
Sqlite database from the old connector setup to the new one. In that process it
96+
We provide a Python script `utils/converter.py` which updates the Grafana
97+
SQLite database from the old connector setup to the new one. In that process it
11898
will go over all the dashboards and create a new version of them with the
11999
updated connector. PLEASE BACKUP THIS FILE BEFORE UPDATING.
120100

@@ -130,8 +110,37 @@ python3 converter.py -o "checkmk" -n "Latest cmk connector" -db grafana.db
130110
```
131111

132112
If any of the two datasources is your default datasource, omit that option on
133-
the command. This script will go over all your dashboards, it might take some
134-
time because it also queries information from your checkmk site, and that
135-
communication takes time.
113+
the command.
114+
115+
This script will go over all your dashboards, it might take some time because it
116+
also queries information from your checkmk site, and that communication takes
117+
time.
136118

137119
4. After the update completes start your Grafana server again.
120+
121+
### Building the plugin
122+
123+
1. Install dependencies
124+
125+
```BASH
126+
yarn install
127+
```
128+
129+
2. Build plugin in development mode or run in watch mode
130+
131+
```BASH
132+
yarn dev
133+
```
134+
135+
or
136+
137+
```BASH
138+
yarn watch
139+
```
140+
141+
3. Build plugin in production mode
142+
143+
```BASH
144+
yarn build
145+
```
146+

dist/README.md

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# Checkmk's Grafana Data Source Plugin
2+
3+
![CI](https://github.com/tribe29/grafana-checkmk-datasource/actions/workflows/node.js.yml/badge.svg)
4+
5+
This datasource plugin is a complete rewrite from the previous connector. It has
6+
undergone a new architectural design and is not backwards compatible to the
7+
previous version. We nervertheless provide an upgrade procedure to assist you on
8+
the transition.
9+
10+
This project has entered the Beta testing phase.
11+
12+
## Requirements
13+
14+
- Checkmk >= 2.0.0p20
15+
- Grafana >= 7.0
16+
17+
This plugin release accompanies the Checkmk 2.1 release. You can use it already
18+
with Checkmk 2.0.0p20 for testing purposes, however bugfixes, changes and
19+
updates will mainly take place on Checkmk 2.1 to not compromise the stability
20+
of Checkmk 2.0.
21+
22+
## Getting started
23+
### Installation
24+
25+
Download the released version of this repository or clone it. Released versions
26+
include the built artifacts, for non-releases you need to build the plugin
27+
yourself as explained further on this guide.
28+
29+
This plugin's id is: `tribe-29-checkmk-datasource`
30+
For development it is easiest to create a symlink inside your Grafana plugins
31+
path(`/var/lib/grafana/plugins`) to this repository. Or if using docker mount
32+
this repository as a volume.
33+
34+
This plugin is not signed, thus you need to allow it on the `grafana.ini` file under
35+
`allow_loading_unsigned_plugins=tribe-29-checkmk-datasource`
36+
37+
Beware that starting Grafana>=8.2 the systemd start script changed permissions
38+
and you need to make sure this plugin is readable under those conditions. [Issue
39+
#52](https://github.com/tribe29/grafana-checkmk-datasource/issues/52#issuecomment-1026917446)
40+
includes troubleshooting information.
41+
42+
43+
### Plugin configuration
44+
URL
45+
: URL of the Checkmk Server used.
46+
: Example: http://checkmk.server/site/
47+
48+
Edition
49+
: Your checkmk edition
50+
: The connector will validate against the checkmk server your selection.
51+
52+
Username
53+
: User for API calls.
54+
: Don't use `automation`, because that user has also admin configuration rights.
55+
Use a dedicated user that has only monitoring permissions.
56+
57+
Secret
58+
: Secret for the API User.
59+
: This key is not transmitted from the Grafana UI, only the backend has access
60+
to it. This is a security improvement over the previous plugin.
61+
62+
Save & Test will check if the User authenticates and the data source is
63+
reachable.
64+
65+
## Current state
66+
67+
- CEE configuration is now a filter based selection of graph templates of single metric.
68+
- RAW configuration offers Service graphs and some single metrics.
69+
70+
- Dropped "Label Format" option. Prefer Grafana overrrides.
71+
- Annotations are not available.
72+
73+
### Combined graphs
74+
75+
- Construct combined graphs using traditional Checkmk filters. Currently available:
76+
- Site filter
77+
- Host exact match
78+
- Host regex
79+
- Service exact match
80+
- Service Regex
81+
- Host labels multi select
82+
- Host groups
83+
- Service groups
84+
- Host Tags
85+
86+
### Minor annoyances
87+
88+
- When selecting a Filter. The focus jumps to the next Filter dropdown menu
89+
instead of the more intuitive focus on the selected filter itself.
90+
- Composed single metrics are not available anymore. E.g. from the Filesystem
91+
service "Free space" is a composed metric being the difference between "Total
92+
Size" and "Used Space".
93+
94+
## Updating from the previous connector
95+
96+
We provide a Python script `utils/converter.py` which will update the Grafana
97+
Sqlite database from the old connector setup to the new one. In that process it
98+
will go over all the dashboards and create a new version of them with the
99+
updated connector. PLEASE BACKUP THIS FILE BEFORE UPDATING.
100+
101+
1. Install and configure this new connector. Take note of the name you give it
102+
and take note of which name you gave the old connector. In this example we call them "Latest cmk connector" and "checkmk".
103+
2. Stop your Grafana instance and backup the file `grafana.db`
104+
3. Use the `converter.py` script, it has a `-h` option to remind you of the
105+
usage. To update from the previous datasource "checkmk" into this new
106+
connector "Latest cmk connector" on the `grafana.db` file, execute:
107+
108+
```BASH
109+
python3 converter.py -o "checkmk" -n "Latest cmk connector" -db grafana.db
110+
```
111+
112+
If any of the two datasources is your default datasource, omit that option on
113+
the command. This script will go over all your dashboards, it might take some
114+
time because it also queries information from your checkmk site, and that
115+
communication takes time.
116+
117+
4. After the update completes start your Grafana server again.
118+
119+
### Building the plugin
120+
121+
1. Install dependencies
122+
123+
```BASH
124+
yarn install
125+
```
126+
127+
2. Build plugin in development mode or run in watch mode
128+
129+
```BASH
130+
yarn dev
131+
```
132+
133+
or
134+
135+
```BASH
136+
yarn watch
137+
```
138+
139+
3. Build plugin in production mode
140+
141+
```BASH
142+
yarn build
143+
```
144+

dist/img/checkmk_logo.png

96.7 KB
Loading

dist/index.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Webpack App</title>
6+
</head>
7+
<body>
8+
<script type="text/javascript" src="/module.js"></script></body>
9+
</html>

dist/module.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/module.js.LICENSE.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*! *****************************************************************************
2+
Copyright (c) Microsoft Corporation.
3+
4+
Permission to use, copy, modify, and/or distribute this software for any
5+
purpose with or without fee is hereby granted.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13+
PERFORMANCE OF THIS SOFTWARE.
14+
***************************************************************************** */

dist/module.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)