Skip to content

Commit 6d3a027

Browse files
committed
feat: add icinga-version
1 parent adff0de commit 6d3a027

11 files changed

Lines changed: 700 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
77

88
## [Unreleased]
99

10+
### Added ("feat")
11+
12+
Icinga Director:
13+
14+
* Icinga2 Service Set
15+
16+
17+
Monitoring Plugins:
18+
19+
* icinga-version: tracks if Icinga is EOL
20+
21+
1022
### Fixed ("fix")
1123

1224
Icinga Director:

assets/icingaweb2-module-director/all-the-rest.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,12 @@
10291029
"entry_value": "Huawei Dorado",
10301030
"format": "string"
10311031
},
1032+
{
1033+
"allowed_roles": null,
1034+
"entry_name": "icinga2",
1035+
"entry_value": "Icinga2",
1036+
"format": "string"
1037+
},
10321038
{
10331039
"allowed_roles": null,
10341040
"entry_name": "icingadb",
@@ -8545,6 +8551,58 @@
85458551
},
85468552
"uuid": "6c2254d7-1d58-40f4-8561-4c3d2eb6dd0c"
85478553
},
8554+
"Icinga2 Service Set": {
8555+
"assign_filter": "\"icinga2\"=host.vars.tags",
8556+
"description": null,
8557+
"object_name": "Icinga2 Service Set",
8558+
"object_type": "template",
8559+
"services": {
8560+
"Icinga Version": {
8561+
"action_url": null,
8562+
"apply_for": null,
8563+
"assign_filter": null,
8564+
"check_command": null,
8565+
"check_interval": null,
8566+
"check_period": null,
8567+
"check_timeout": null,
8568+
"command_endpoint": null,
8569+
"disabled": false,
8570+
"display_name": null,
8571+
"enable_active_checks": null,
8572+
"enable_event_handler": null,
8573+
"enable_flapping": null,
8574+
"enable_notifications": null,
8575+
"enable_passive_checks": null,
8576+
"enable_perfdata": null,
8577+
"event_command": null,
8578+
"fields": [],
8579+
"flapping_threshold_high": null,
8580+
"flapping_threshold_low": null,
8581+
"groups": [],
8582+
"host": null,
8583+
"icon_image": null,
8584+
"icon_image_alt": null,
8585+
"imports": [
8586+
"tpl-service-icinga2-version"
8587+
],
8588+
"max_check_attempts": null,
8589+
"notes": null,
8590+
"notes_url": null,
8591+
"object_name": "Icinga Version",
8592+
"object_type": "object",
8593+
"retry_interval": null,
8594+
"service_set": null,
8595+
"template_choice": null,
8596+
"use_agent": null,
8597+
"use_var_overrides": null,
8598+
"uuid": "da2051b0-694d-4d2f-ac57-d24a5b30c675",
8599+
"vars": {},
8600+
"volatile": null,
8601+
"zone": null
8602+
}
8603+
},
8604+
"uuid": "c4eafde5-18c3-4c40-9b14-0d557938e789"
8605+
},
85488606
"IcingaDB Service Set": {
85498607
"assign_filter": "\"icingadb\"=host.vars.tags",
85508608
"description": null,

check-plugins/about-me/about-me

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ except ImportError:
4040

4141

4242
__author__ = 'Linuxfabrik GmbH, Zurich/Switzerland'
43-
__version__ = '2025060601 / v2.0.0'
43+
__version__ = '2025061901'
4444

4545
DESCRIPTION = 'Provides a quick overview of host dimensions and software.'
4646

@@ -303,6 +303,7 @@ def get_lftags(distro):
303303
{'sw': 'H-Net eFaktura', 'package': [], 'expr': [run_cmd('systemctl is-enabled hnet-securesvc.service', ignore_output=True)]}, # pylint: disable=C0301
304304
{'sw': 'HAProxy', 'package': [], 'expr': [run_cmd('systemctl is-enabled haproxy.service', ignore_output=True)]}, # pylint: disable=C0301
305305
# {'sw': 'Huawei Dorado', 'package': [], 'expr': []}, # pylint: disable=C0301
306+
{'sw': 'Icinga2', 'package': [], 'expr': [run_cmd('systemctl is-enabled icinga2.service', ignore_output=True)]}, # pylint: disable=C0301
306307
{'sw': 'IcingaDB', 'package': [], 'expr': [run_cmd('systemctl is-enabled icingadb.service', ignore_output=True)]}, # pylint: disable=C0301
307308
{'sw': 'InfluxDB', 'package': [], 'expr': [run_cmd('systemctl is-enabled influxdb.service', ignore_output=True)]}, # pylint: disable=C0301
308309
# {'sw': 'Infomaniak Swiss Backup', 'package': [], 'expr': []}, # pylint: disable=C0301
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
Check icinga-version
2+
====================
3+
4+
Overview
5+
--------
6+
7+
This plugin lets you track if Icinga is End-of-Life (EOL). To compare against the current/installed version of Icinga, the check has to run on the host running the Icinga2 daemon itself.
8+
9+
This check plugin alerts n days before or after the EOL date is reached. Optionally, it can also alert on available major, minor or patch releases (each independently).
10+
11+
12+
Fact Sheet
13+
----------
14+
15+
.. csv-table::
16+
:widths: 30, 70
17+
18+
"Check Plugin Download", "https://github.com/Linuxfabrik/monitoring-plugins/tree/main/check-plugins/icinga-version"
19+
"Check Interval Recommendation", "Once a day"
20+
"Can be called without parameters", "Yes"
21+
"Compiled for Windows", "No"
22+
"Uses SQLite DBs", "``$TEMP/linuxfabrik-lib-version.db``"
23+
24+
25+
Help
26+
----
27+
28+
.. code-block:: text
29+
30+
usage: icinga-version [-h] [-V] [--always-ok] [--check-major] [--check-minor]
31+
[--check-patch] [--insecure] [--no-proxy]
32+
[--offset-eol OFFSET_EOL] [--timeout TIMEOUT]
33+
34+
Tracks if Icinga is EOL.
35+
36+
options:
37+
-h, --help show this help message and exit
38+
-V, --version show program's version number and exit
39+
--always-ok Always returns OK.
40+
--check-major Alert me when there is a new major release available,
41+
even if the current version of my product is not EOL.
42+
Example: Notify when I run v26 (not yet EOL) and v27
43+
is available. Default: False
44+
--check-minor Alert me when there is a new major.minor release
45+
available, even if the current version of my product
46+
is not EOL. Example: Notify when I run v26.2 (not yet
47+
EOL) and v26.3 is available. Default: False
48+
--check-patch Alert me when there is a new major.minor.patch release
49+
available, even if the current version of my product
50+
is not EOL. Example: Notify when I run v26.2.7 (not
51+
yet EOL) and v26.2.8 is available. Default: False
52+
--insecure This option explicitly allows to perform "insecure"
53+
SSL connections. Default: False
54+
--no-proxy Do not use a proxy. Default: False
55+
--offset-eol OFFSET_EOL
56+
Alert me n days before ("-30") or after an EOL date
57+
("30" or "+30"). Default: -30 days
58+
--timeout TIMEOUT Network timeout in seconds. Default: 8 (seconds)
59+
60+
61+
Usage Examples
62+
--------------
63+
64+
.. code-block:: bash
65+
66+
./icinga-version --offset-eol=-30
67+
68+
Output:
69+
70+
.. code-block:: text
71+
72+
Icinga v2.14.6 (EOL unknown)
73+
74+
75+
States
76+
------
77+
78+
* WARN if software is EOL
79+
* Optional: WARN when new major version is available
80+
* Optional: WARN when new minor version is available
81+
* Optional: WARN when new patch version is available
82+
83+
84+
Perfdata / Metrics
85+
------------------
86+
87+
.. csv-table::
88+
:widths: 25, 15, 60
89+
:header-rows: 1
90+
91+
Name, Type, Description
92+
icinga-version, Number, Installed Icinga version as float. "2.14.6" becomes "2.146".
93+
94+
95+
Credits, License
96+
----------------
97+
98+
* Authors: `Linuxfabrik GmbH, Zurich <https://www.linuxfabrik.ch>`_
99+
* License: The Unlicense, see `LICENSE file <https://unlicense.org/>`_.
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
apiVersion: grizzly.grafana.com/v1alpha1
2+
kind: Dashboard
3+
metadata:
4+
folder: linuxfabrik-monitoring-plugins
5+
name: icinga-version
6+
spec:
7+
schemaVersion: 2023041201
8+
tags:
9+
- Linuxfabrik
10+
- Grizzly
11+
- static
12+
time:
13+
from: now-90d
14+
to: now
15+
timepicker:
16+
hidden: false
17+
refresh_intervals:
18+
- 1m
19+
timezone: browser
20+
title: Icinga Version
21+
uid: linuxfabrik-monitoring-plugins-icinga-version
22+
editable: true
23+
liveNow: true
24+
refresh: 1m
25+
templating:
26+
list:
27+
- label: Command
28+
name: command
29+
query: SHOW MEASUREMENTS WITH MEASUREMENT =~ /.*icinga-version.*/
30+
current:
31+
text: cmd-check-icinga-version
32+
value: cmd-check-icinga-version
33+
refresh: 1
34+
sort: 1
35+
type: query
36+
- label: Hostname
37+
name: hostname
38+
query: SHOW TAG VALUES FROM "$command" WITH KEY = "hostname"
39+
refresh: 1
40+
sort: 1
41+
type: query
42+
- label: Service
43+
name: service
44+
query: SHOW TAG VALUES FROM "$command" WITH KEY = "service" WHERE hostname = '$hostname'
45+
refresh: 1
46+
sort: 1
47+
type: query
48+
49+
panels:
50+
51+
- title: Icinga Version
52+
type: timeseries
53+
gridPos:
54+
h: 8
55+
w: 12
56+
x: 0
57+
y: 0
58+
fieldConfig:
59+
defaults:
60+
color:
61+
mode: palette-classic
62+
custom:
63+
lineInterpolation: smooth
64+
showPoints: always
65+
spanNulls: true
66+
decimals: 2
67+
unit: none
68+
options:
69+
legend:
70+
calcs:
71+
- min
72+
- max
73+
displayMode: table
74+
placement: bottom
75+
showLegend: true
76+
tooltip:
77+
mode: multi
78+
sort: none
79+
80+
targets:
81+
82+
- alias: icinga-version
83+
refId: icinga-version
84+
groupBy:
85+
- params:
86+
- $interval
87+
type: time
88+
measurement: $command
89+
resultFormat: time_series
90+
select:
91+
- - params:
92+
- value
93+
type: field
94+
- params: []
95+
type: mean
96+
tags:
97+
- key: hostname
98+
operator: '='
99+
value: $hostname
100+
- condition: AND
101+
key: service
102+
operator: '='
103+
value: $service
104+
- condition: AND
105+
key: metric
106+
operator: '='
107+
value: icinga-version

0 commit comments

Comments
 (0)