netbox-checkmk 0.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- netbox_checkmk-0.3.2/CHANGELOG.md +67 -0
- netbox_checkmk-0.3.2/LICENSE +202 -0
- netbox_checkmk-0.3.2/MANIFEST.in +4 -0
- netbox_checkmk-0.3.2/NOTICE +10 -0
- netbox_checkmk-0.3.2/PKG-INFO +285 -0
- netbox_checkmk-0.3.2/README.md +257 -0
- netbox_checkmk-0.3.2/netbox_checkmk/__init__.py +41 -0
- netbox_checkmk-0.3.2/netbox_checkmk/checkmk.py +272 -0
- netbox_checkmk-0.3.2/netbox_checkmk/locale/de/LC_MESSAGES/django.mo +0 -0
- netbox_checkmk-0.3.2/netbox_checkmk/locale/de/LC_MESSAGES/django.po +100 -0
- netbox_checkmk-0.3.2/netbox_checkmk/signals.py +34 -0
- netbox_checkmk-0.3.2/netbox_checkmk/status.py +123 -0
- netbox_checkmk-0.3.2/netbox_checkmk/tables.py +34 -0
- netbox_checkmk-0.3.2/netbox_checkmk/templates/netbox_checkmk/inc/panel_content.html +129 -0
- netbox_checkmk-0.3.2/netbox_checkmk/templates/netbox_checkmk/inc/service_counts.html +1 -0
- netbox_checkmk-0.3.2/netbox_checkmk/templates/netbox_checkmk/inc/tab_badges.html +1 -0
- netbox_checkmk-0.3.2/netbox_checkmk/templates/netbox_checkmk/tab.html +27 -0
- netbox_checkmk-0.3.2/netbox_checkmk/templatetags/__init__.py +0 -0
- netbox_checkmk-0.3.2/netbox_checkmk/templatetags/checkmk_tags.py +72 -0
- netbox_checkmk-0.3.2/netbox_checkmk/urls.py +8 -0
- netbox_checkmk-0.3.2/netbox_checkmk/views.py +182 -0
- netbox_checkmk-0.3.2/netbox_checkmk.egg-info/PKG-INFO +285 -0
- netbox_checkmk-0.3.2/netbox_checkmk.egg-info/SOURCES.txt +26 -0
- netbox_checkmk-0.3.2/netbox_checkmk.egg-info/dependency_links.txt +1 -0
- netbox_checkmk-0.3.2/netbox_checkmk.egg-info/requires.txt +1 -0
- netbox_checkmk-0.3.2/netbox_checkmk.egg-info/top_level.txt +1 -0
- netbox_checkmk-0.3.2/pyproject.toml +53 -0
- netbox_checkmk-0.3.2/setup.cfg +4 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.3.2] - 2026-10-12
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Published on PyPI as `netbox-checkmk` (CI job with PyPI Trusted Publishing on tag pushes).
|
|
8
|
+
- PyPI metadata: keywords and classifiers. The README uses absolute links, so images and links
|
|
9
|
+
also work on PyPI.
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- The source package no longer ships the unit tests (they need files that weren't included);
|
|
14
|
+
it now includes `CHANGELOG.md`.
|
|
15
|
+
|
|
16
|
+
## [0.3.1] - 2026-10-12
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- License changed from GPL-2.0-only to **Apache-2.0** (the license of NetBox itself and of most
|
|
21
|
+
plugins in the NetBox plugin catalog). A `NOTICE` file with the copyright holder must be
|
|
22
|
+
kept by forks and redistributions. Versions up to 0.3.0 were only distributed privately.
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
|
|
26
|
+
- Trademark notice for NetBox and Checkmk in the README and `NOTICE`.
|
|
27
|
+
|
|
28
|
+
- Package metadata: project URLs (homepage, source, changelog), license file and a
|
|
29
|
+
`Topic :: System :: Monitoring` classifier.
|
|
30
|
+
|
|
31
|
+
## [0.3.0] - 2026-10-12
|
|
32
|
+
|
|
33
|
+
### Added
|
|
34
|
+
|
|
35
|
+
- Optional "Checkmk" column for the device, virtual machine and cluster lists (host state +
|
|
36
|
+
service counts, lazy-loaded), registered via NetBox's `register_table_column` plugin API.
|
|
37
|
+
- The `checkmk_hostname` custom field is created automatically on `manage.py migrate` for
|
|
38
|
+
devices, virtual machines and clusters (`create_custom_field`, default on). An existing field
|
|
39
|
+
is never changed.
|
|
40
|
+
- German translation. The UI follows the NetBox user's language.
|
|
41
|
+
- README: setting up a dedicated Checkmk automation user (guest role), screenshots.
|
|
42
|
+
- `LICENSE` file (GPL-2.0-only at the time, as declared in `pyproject.toml`).
|
|
43
|
+
- Integration test matrix extended to NetBox 4.5.10 and 4.6.10.
|
|
44
|
+
|
|
45
|
+
## [0.2.0] - 2026-10-12
|
|
46
|
+
|
|
47
|
+
### Added
|
|
48
|
+
|
|
49
|
+
- The "Checkmk" tab label shows the number of OK/WARN/CRIT/UNKNOWN services as number-only
|
|
50
|
+
badges in the state's color (zero counts hidden), plus a DOWN/UNREACH badge when the host is
|
|
51
|
+
down. Clusters show the counts summed over all members. Loaded asynchronously.
|
|
52
|
+
- Service names in the Checkmk tab link to the service in Checkmk.
|
|
53
|
+
|
|
54
|
+
### Changed
|
|
55
|
+
|
|
56
|
+
- The query interval is configurable as `check_interval` (default 300 s, i.e. 5 min). An open
|
|
57
|
+
Checkmk tab reloads itself at that interval.
|
|
58
|
+
|
|
59
|
+
## [0.1.0] - 2026-10-12
|
|
60
|
+
|
|
61
|
+
### Added
|
|
62
|
+
|
|
63
|
+
- "Checkmk" tab on device, virtual machine and cluster detail pages showing live host and
|
|
64
|
+
service state from one or more Checkmk sites (loaded asynchronously, cached).
|
|
65
|
+
- Case-insensitive host name matching, with an optional `checkmk_hostname` custom field
|
|
66
|
+
override.
|
|
67
|
+
- Cluster tab aggregating the worst state of all member devices and VMs.
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
netbox-checkmk
|
|
2
|
+
Copyright 2026 Christian Wirtz
|
|
3
|
+
|
|
4
|
+
This product is licensed under the Apache License, Version 2.0 (see LICENSE).
|
|
5
|
+
Redistributions and derivative works must retain this NOTICE file (Apache License 2.0,
|
|
6
|
+
section 4(d)).
|
|
7
|
+
|
|
8
|
+
NetBox is a trademark of NetBox Labs, Inc. Checkmk is a trademark of Checkmk GmbH.
|
|
9
|
+
This project is an unofficial, independent community project and is not affiliated with
|
|
10
|
+
or endorsed by NetBox Labs or Checkmk GmbH.
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: netbox-checkmk
|
|
3
|
+
Version: 0.3.2
|
|
4
|
+
Summary: NetBox plugin showing live Checkmk monitoring status on devices, VMs and clusters
|
|
5
|
+
Author-email: Christian Wirtz <doc@snowheaven.de>
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://gitlab.com/checkmk1/netbox_checkmk_plugin
|
|
8
|
+
Project-URL: Source, https://gitlab.com/checkmk1/netbox_checkmk_plugin
|
|
9
|
+
Project-URL: Changelog, https://gitlab.com/checkmk1/netbox_checkmk_plugin/-/blob/main/CHANGELOG.md
|
|
10
|
+
Keywords: netbox,netbox-plugin,checkmk,monitoring
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Environment :: Web Environment
|
|
13
|
+
Classifier: Framework :: Django
|
|
14
|
+
Classifier: Intended Audience :: System Administrators
|
|
15
|
+
Classifier: Natural Language :: English
|
|
16
|
+
Classifier: Natural Language :: German
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
20
|
+
Classifier: Topic :: System :: Monitoring
|
|
21
|
+
Classifier: Topic :: System :: Networking :: Monitoring
|
|
22
|
+
Requires-Python: >=3.10
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
License-File: NOTICE
|
|
26
|
+
Requires-Dist: requests
|
|
27
|
+
Dynamic: license-file
|
|
28
|
+
|
|
29
|
+
# netbox-checkmk
|
|
30
|
+
|
|
31
|
+
NetBox plugin that shows live **Checkmk monitoring state** on devices, virtual machines and
|
|
32
|
+
clusters, in a dedicated **"Checkmk" tab** on each object's detail page.
|
|
33
|
+
|
|
34
|
+

|
|
35
|
+
|
|
36
|
+
- **Tab label badges:** the "Checkmk" tab shows the number of OK / WARN / CRIT / UNKNOWN
|
|
37
|
+
services as number-only badges in the state's color (zero counts hidden), plus a DOWN /
|
|
38
|
+
UNREACH badge when the host is down. They are visible from every tab of the object.
|
|
39
|
+
- **Device / Virtual machine tab:** host state (UP/DOWN/UNREACH/PEND), acknowledgement and
|
|
40
|
+
downtime flags, plugin output, service state counts, last check time, and the full service
|
|
41
|
+
list (worst state first) with each service's output. The host and every service link straight
|
|
42
|
+
to their views in Checkmk.
|
|
43
|
+
- **Cluster tab:** overall (worst) state across all member devices and VMs, the cluster's own
|
|
44
|
+
Checkmk host (if one exists with that name), and a member table sorted worst-first. The tab
|
|
45
|
+
label badges show the service counts summed over all members.
|
|
46
|
+
- **List column:** an optional "Checkmk" column for the device, virtual machine and cluster
|
|
47
|
+
lists (host state + service counts), enabled per user via *Configure Table*.
|
|
48
|
+
- **English and German:** the UI follows the NetBox user's language setting.
|
|
49
|
+
- **Multiple Checkmk sites:** queried in configured order; the first site that knows a host wins.
|
|
50
|
+
- **Non-blocking:** the tab loads its content asynchronously (htmx), so a slow or unreachable
|
|
51
|
+
Checkmk site never delays the NetBox page. State is fetched from Checkmk at most every
|
|
52
|
+
`check_interval` seconds (default 300 = 5 min), and an open tab reloads itself at that
|
|
53
|
+
interval. The tab's *Refresh* button bypasses the cache.
|
|
54
|
+
- **Read-only:** the plugin only reads monitoring status from the Checkmk REST API.
|
|
55
|
+
- **Standard plugin APIs only:** an extra tab via `register_model_view`/`ViewTab`, the list
|
|
56
|
+
column via `register_table_column`, and the plugin's own views. NetBox's code and templates
|
|
57
|
+
are not touched.
|
|
58
|
+
|
|
59
|
+

|
|
60
|
+
|
|
61
|
+

|
|
62
|
+
|
|
63
|
+
The screenshots are generated by the integration test against a throwaway Checkmk site with
|
|
64
|
+
demo services: `SCREENSHOT_DIR=docs/screenshots NETBOX_VERSIONS=v4.7.2 scripts/integration_test.sh`.
|
|
65
|
+
That mode needs `python3` on the machine running the script.
|
|
66
|
+
|
|
67
|
+
## Host name mapping
|
|
68
|
+
|
|
69
|
+
A NetBox object is matched to the Checkmk host with the same name, **case-insensitively**
|
|
70
|
+
(`NB-VM1` in NetBox finds `nb-vm1` in Checkmk). If the names differ, set the custom field
|
|
71
|
+
**Checkmk host name** (`checkmk_hostname`) on the object; its value is then used instead of the
|
|
72
|
+
object name.
|
|
73
|
+
|
|
74
|
+
The plugin creates this text custom field for devices, virtual machines and clusters on
|
|
75
|
+
`manage.py migrate` if it doesn't exist yet. An existing field with that name is never changed.
|
|
76
|
+
To name it differently, set `hostname_custom_field`; to create it yourself, set
|
|
77
|
+
`create_custom_field: False`.
|
|
78
|
+
|
|
79
|
+
## Requirements
|
|
80
|
+
|
|
81
|
+
- NetBox 4.3 or newer
|
|
82
|
+
- Checkmk 2.5 or 3.0 (REST API), with a user per site for NetBox (see below).
|
|
83
|
+
|
|
84
|
+
## Checkmk user for NetBox
|
|
85
|
+
|
|
86
|
+
The plugin only reads, so a dedicated **automation user with the built-in "Guest user" role** is
|
|
87
|
+
all it needs. That role may see all hosts and services, and can't change anything. Don't use a
|
|
88
|
+
personal account: its password ends up in NetBox's configuration.
|
|
89
|
+
|
|
90
|
+
In each Checkmk site:
|
|
91
|
+
|
|
92
|
+
1. *Setup → Users → Users → Add user*
|
|
93
|
+
2. **Username** e.g. `netbox`, **Full name** e.g. `NetBox`
|
|
94
|
+
3. **Authentication:** *Automation secret for machine accounts*, then generate a secret and copy it
|
|
95
|
+
4. **Roles:** only *Guest user*; no contact groups, no notifications needed
|
|
96
|
+
5. Save and *activate changes*
|
|
97
|
+
|
|
98
|
+
Or with the REST API, as an admin. This is the call the integration test uses:
|
|
99
|
+
|
|
100
|
+
```sh
|
|
101
|
+
curl -u 'cmkadmin:<password>' -X POST -H 'Content-Type: application/json' \
|
|
102
|
+
https://cmk.example.com/mysite/check_mk/api/1.0/domain-types/user_config/collections/all \
|
|
103
|
+
-d '{"username": "netbox", "fullname": "NetBox", "roles": ["guest"],
|
|
104
|
+
"auth_option": {"auth_type": "automation", "secret": "<long random secret>"}}'
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Then put `username` and `secret` into the site entry of the configuration (see *Configuration* below).
|
|
108
|
+
Check it from the NetBox host:
|
|
109
|
+
|
|
110
|
+
```sh
|
|
111
|
+
curl -s -H 'Authorization: Bearer netbox <secret>' \
|
|
112
|
+
https://cmk.example.com/mysite/check_mk/api/1.0/version
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Installation
|
|
116
|
+
|
|
117
|
+
The plugin is on PyPI as [`netbox-checkmk`](https://pypi.org/project/netbox-checkmk/). Each
|
|
118
|
+
GitLab release also carries the wheel. The plugin has no database models and no static files.
|
|
119
|
+
Run `manage.py migrate` once anyway: that's where it creates its custom field.
|
|
120
|
+
|
|
121
|
+
### Classic installation (`/opt/netbox`, systemd)
|
|
122
|
+
|
|
123
|
+
These steps were used on a real NetBox 4.7.1 installation (Debian 13, `/opt/netbox`, services
|
|
124
|
+
`netbox` and `netbox-rq`):
|
|
125
|
+
|
|
126
|
+
```sh
|
|
127
|
+
# 1. Back up the configuration
|
|
128
|
+
cp -a /opt/netbox/netbox/netbox/configuration.py /root/configuration.py.bak-$(date +%F)
|
|
129
|
+
|
|
130
|
+
# 2. Install it into NetBox's venv
|
|
131
|
+
/opt/netbox/venv/bin/pip install netbox-checkmk
|
|
132
|
+
|
|
133
|
+
# 3. So that NetBox's own upgrade.sh reinstalls the plugin on NetBox upgrades
|
|
134
|
+
echo netbox-checkmk >> /opt/netbox/local_requirements.txt
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
4. In `/opt/netbox/netbox/netbox/configuration.py`, add `"netbox_checkmk"` to `PLUGINS` and append
|
|
138
|
+
the plugin configuration (see *Configuration* below).
|
|
139
|
+
|
|
140
|
+
```sh
|
|
141
|
+
# 5. Validate, create the custom field, restart, check
|
|
142
|
+
cd /opt/netbox/netbox && runuser -u netbox -- /opt/netbox/venv/bin/python manage.py check
|
|
143
|
+
runuser -u netbox -- /opt/netbox/venv/bin/python manage.py migrate
|
|
144
|
+
systemctl restart netbox netbox-rq
|
|
145
|
+
systemctl is-active netbox netbox-rq
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
6. Open a device or VM: the tab bar now has a **Checkmk** tab.
|
|
149
|
+
|
|
150
|
+
To update: `/opt/netbox/venv/bin/pip install -U netbox-checkmk`, then run `migrate` and restart
|
|
151
|
+
both services as in step 5.
|
|
152
|
+
|
|
153
|
+
Without internet access on the NetBox host, copy the wheel there (e.g. to
|
|
154
|
+
`/opt/netbox/local_plugins/`), `pip install` that file, and put its path into
|
|
155
|
+
`local_requirements.txt` instead of the package name.
|
|
156
|
+
|
|
157
|
+
### netbox-docker
|
|
158
|
+
|
|
159
|
+
Build a custom image with the plugin. `plugin_requirements.txt`:
|
|
160
|
+
|
|
161
|
+
```text
|
|
162
|
+
netbox-checkmk
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
`Dockerfile-Plugins`:
|
|
166
|
+
|
|
167
|
+
```dockerfile
|
|
168
|
+
FROM netboxcommunity/netbox:v4.7.2
|
|
169
|
+
COPY ./plugin_requirements.txt /opt/netbox/
|
|
170
|
+
RUN /usr/local/bin/uv pip install --python /opt/netbox/venv/bin/python \
|
|
171
|
+
-r /opt/netbox/plugin_requirements.txt
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
`docker-compose.override.yml`:
|
|
175
|
+
|
|
176
|
+
```yaml
|
|
177
|
+
services:
|
|
178
|
+
netbox:
|
|
179
|
+
image: netbox:latest-plugins
|
|
180
|
+
pull_policy: never
|
|
181
|
+
build:
|
|
182
|
+
context: .
|
|
183
|
+
dockerfile: Dockerfile-Plugins
|
|
184
|
+
netbox-worker:
|
|
185
|
+
image: netbox:latest-plugins
|
|
186
|
+
pull_policy: never
|
|
187
|
+
netbox-housekeeping:
|
|
188
|
+
image: netbox:latest-plugins
|
|
189
|
+
pull_policy: never
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Put the configuration into `configuration/plugins.py`, then run
|
|
193
|
+
`docker compose build --no-cache && docker compose up -d`.
|
|
194
|
+
|
|
195
|
+
The `Dockerfile-Plugins` build was verified (the plugin installs into the image), and the
|
|
196
|
+
integration test runs the plugin in the same image with its config in `plugins.py`. The full
|
|
197
|
+
`docker compose` stack itself has not been run.
|
|
198
|
+
|
|
199
|
+
## Configuration
|
|
200
|
+
|
|
201
|
+
```python
|
|
202
|
+
PLUGINS = ["netbox_checkmk"]
|
|
203
|
+
|
|
204
|
+
PLUGINS_CONFIG = {
|
|
205
|
+
"netbox_checkmk": {
|
|
206
|
+
"sites": [
|
|
207
|
+
{
|
|
208
|
+
"name": "main", # label shown in NetBox
|
|
209
|
+
"url": "https://cmk.example.com/mysite", # site URL, without /check_mk
|
|
210
|
+
"username": "netbox", # automation user
|
|
211
|
+
"secret": "…", # its automation secret
|
|
212
|
+
"verify_ssl": True, # optional, default True
|
|
213
|
+
"timeout": 5, # optional, seconds
|
|
214
|
+
},
|
|
215
|
+
# further sites …
|
|
216
|
+
],
|
|
217
|
+
"check_interval": 300, # seconds between Checkmk queries (cache + tab auto-reload)
|
|
218
|
+
"hostname_custom_field": "checkmk_hostname",
|
|
219
|
+
"create_custom_field": True, # create it on `manage.py migrate` if missing
|
|
220
|
+
"max_services": 500, # services listed on a device/VM tab
|
|
221
|
+
"max_cluster_members": 100, # members evaluated on a cluster tab
|
|
222
|
+
},
|
|
223
|
+
}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Before restarting, check that the NetBox host can reach each Checkmk site:
|
|
227
|
+
|
|
228
|
+
```sh
|
|
229
|
+
curl -s -u '<user>:<secret>' https://cmk.example.com/mysite/check_mk/api/1.0/version
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Permissions follow NetBox: users only see the tab, and its data, for objects they are allowed
|
|
233
|
+
to view.
|
|
234
|
+
|
|
235
|
+
## Behaviour on errors
|
|
236
|
+
|
|
237
|
+
If a site cannot be queried (unreachable, wrong credentials, …), the tab shows a warning naming
|
|
238
|
+
the site. Hosts that were not found on any reachable site are then reported as "could not be
|
|
239
|
+
determined" rather than "not found", and that result is not cached.
|
|
240
|
+
|
|
241
|
+
## Development
|
|
242
|
+
|
|
243
|
+
```sh
|
|
244
|
+
pip install ruff pytest requests
|
|
245
|
+
ruff check . && ruff format --check . && pytest -q # unit tests (no NetBox needed)
|
|
246
|
+
|
|
247
|
+
# After editing netbox_checkmk/locale/de/LC_MESSAGES/django.po (no GNU gettext needed):
|
|
248
|
+
python scripts/compile_translations.py
|
|
249
|
+
|
|
250
|
+
# Integration test: real Checkmk site + NetBox per version, all in Docker
|
|
251
|
+
CHECKMK_VERSION=2.5.0p15 NETBOX_VERSIONS="v4.3.7 v4.7.2" scripts/integration_test.sh # default: 4.3 … 4.7
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
The integration test creates hosts in a throwaway Checkmk site, forces their states via
|
|
255
|
+
Livestatus, and then checks the tabs and status content through NetBox's own Django stack:
|
|
256
|
+
automatic custom field creation, case-insensitive matching, the custom field override, cluster
|
|
257
|
+
aggregation, tab label badges, the list column, host and service links, the German translation,
|
|
258
|
+
multi-site fallback with a broken site, caching, and permissions.
|
|
259
|
+
It uses `docker create`/`cp`/`exec` only (no bind mounts, no published ports), so it also works
|
|
260
|
+
against a remote Docker daemon (`DOCKER_CONTEXT`/`DOCKER_HOST`).
|
|
261
|
+
|
|
262
|
+
CI runs lint and unit tests on every push. The integration test, package build and GitLab
|
|
263
|
+
release run on tag pushes (`vX.Y.Z`, which must match `__version__`).
|
|
264
|
+
|
|
265
|
+
## Tested with
|
|
266
|
+
|
|
267
|
+
Plugin version 0.3.0, integration test (`scripts/integration_test.sh`), 2026-10-12:
|
|
268
|
+
|
|
269
|
+
| Checkmk | NetBox `v4.3.7` | `v4.4.10` | `v4.5.10` | `v4.6.10` | `v4.7.2` |
|
|
270
|
+
| --- | --- | --- | --- | --- | --- |
|
|
271
|
+
| `2.5.0p15` (check-mk-ultimate) | passed | passed | passed | passed | passed |
|
|
272
|
+
| `3.0.0-2026.10.12` (check-mk-ultimate daily) | passed | passed | passed | passed | passed |
|
|
273
|
+
|
|
274
|
+
Also running on a real installation: NetBox `4.7.1` (classic install, Debian 13) with Checkmk
|
|
275
|
+
`2.5.0p15`. Version 0.1.0 was installed by hand via the classic path above, and later versions
|
|
276
|
+
were rolled out automatically with the same steps.
|
|
277
|
+
|
|
278
|
+
## License
|
|
279
|
+
|
|
280
|
+
Copyright 2026 Christian Wirtz. Licensed under the [Apache License 2.0](https://gitlab.com/checkmk1/netbox_checkmk_plugin/-/blob/main/LICENSE). Forks and
|
|
281
|
+
redistributions must keep the [NOTICE](https://gitlab.com/checkmk1/netbox_checkmk_plugin/-/blob/main/NOTICE) file (section 4(d) of the license).
|
|
282
|
+
|
|
283
|
+
*NetBox is a trademark of NetBox Labs, Inc. Checkmk is a trademark of Checkmk GmbH. This project
|
|
284
|
+
is an unofficial, independent community project and is not affiliated with or endorsed by
|
|
285
|
+
NetBox Labs or Checkmk GmbH.*
|