Skip to content

Commit 22336a6

Browse files
committed
refactor(matomo-version): use EOL library, parameter --cache-expire is deprecated
1 parent 46de8b3 commit 22336a6

File tree

5 files changed

+296
-76
lines changed

5 files changed

+296
-76
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ Monitoring Plugins:
1414
* disk-usage: handle disk accessibility ([#792](https://github.com/Linuxfabrik/monitoring-plugins/issues/792))
1515

1616

17+
### Changed ("refactor", "chore" etc.)
18+
19+
Monitoring Plugins:
20+
21+
* matomo-version: use EOL library, parameter `--cache-expire` is deprecated
22+
23+
1724

1825
## [v2.0.0] - 2025-06-06
1926

check-plugins/matomo-version/README.rst

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ Check matomo-version
44
Overview
55
--------
66

7-
This plugin lets you track if a matomo server update is available. To check for updates, this plugin uses the Git Repo at https://github.com/matomo-org/matomo/releases. To compare against the current/installed version of Matomo, the check has to run on the Matomo server itself and needs access to the Matomo installation directory.
7+
This plugin lets you track if Matomo is End-of-Life (EOL). To compare against the current/installed version of Matomo, the check has to run on the Matomo server 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).
810

911

1012
Fact Sheet
@@ -17,57 +19,82 @@ Fact Sheet
1719
"Check Interval Recommendation", "Once a day"
1820
"Can be called without parameters", "Yes"
1921
"Compiled for Windows", "No"
20-
"Uses SQLite DBs", "Yes"
22+
"Uses SQLite DBs", "``$TEMP/linuxfabrik-lib-version.db``"
2123

2224

2325
Help
2426
----
2527

2628
.. code-block:: text
2729
28-
usage: matomo-version [-h] [-V] [--always-ok] [--cache-expire CACHE_EXPIRE]
29-
[--path PATH]
30+
usage: matomo-version [-h] [-V] [--always-ok] [--check-major] [--check-minor]
31+
[--check-patch] [--insecure] [--no-proxy]
32+
[--offset-eol OFFSET_EOL] [--path PATH]
33+
[--timeout TIMEOUT]
3034
31-
This plugin lets you track if server updates are available.
35+
Tracks if Matomo is EOL.
3236
3337
options:
3438
-h, --help show this help message and exit
3539
-V, --version show program's version number and exit
3640
--always-ok Always returns OK.
37-
--cache-expire CACHE_EXPIRE
38-
The amount of time after which the update check cache
39-
expires, in hours. Default: 24
41+
--check-major Alert me when there is a new major release available,
42+
even if the current version of my product is not EOL.
43+
Example: Notify when I run v26 (not yet EOL) and v27
44+
is available. Default: False
45+
--check-minor Alert me when there is a new major.minor release
46+
available, even if the current version of my product
47+
is not EOL. Example: Notify when I run v26.2 (not yet
48+
EOL) and v26.3 is available. Default: False
49+
--check-patch Alert me when there is a new major.minor.patch release
50+
available, even if the current version of my product
51+
is not EOL. Example: Notify when I run v26.2.7 (not
52+
yet EOL) and v26.2.8 is available. Default: False
53+
--insecure This option explicitly allows to perform "insecure"
54+
SSL connections. Default: False
55+
--no-proxy Do not use a proxy. Default: False
56+
--offset-eol OFFSET_EOL
57+
Alert me n days before ("-30") or after an EOL date
58+
("30" or "+30"). Default: -30 days
4059
--path PATH Local path to your Matomo/Piwik installation,
4160
typically within your Webserver's Document Root.
4261
Default: /var/www/html/matomo
62+
--timeout TIMEOUT Network timeout in seconds. Default: 8 (seconds)
4363
4464
4565
Usage Examples
4666
--------------
4767

4868
.. code-block:: bash
4969
50-
./matomo-version --path /var/www/html/matomo
51-
./matomo-version --path /var/www/html/matomo --cache-expire 8 --always-ok
70+
./matomo-version --path=/var/www/html/matomo
71+
./matomo-version --path=/var/www/html/matomo --offset-eol=-30
5272
5373
Output:
5474

5575
.. code-block:: text
5676
57-
Matomo v4.3.1 is up to date
77+
Matomo v5.3.2 (EOL unknown)
5878
5979
6080
States
6181
------
6282

63-
* If wanted, always returns OK,
64-
* else returns WARN if update is available.
83+
* WARN if software is EOL
84+
* Optional: WARN when new major version is available
85+
* Optional: WARN when new minor version is available
86+
* Optional: WARN when new patch version is available
6587

6688

6789
Perfdata / Metrics
6890
------------------
6991

70-
There is no perfdata.
92+
.. csv-table::
93+
:widths: 25, 15, 60
94+
:header-rows: 1
95+
96+
Name, Type, Description
97+
matomo-version, Number, Installed Matomo version as float. "5.3.2" becomes "5.32".
7198

7299

73100
Credits, License

check-plugins/matomo-version/icingaweb2-module-director/matomo-version.json

Lines changed: 122 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,29 @@
55
"--always-ok": {
66
"set_if": "$matomo_version_always_ok$"
77
},
8-
"--cache-expire": {
9-
"value": "$matomo_version_cache_expire$"
8+
"--check-major": {
9+
"set_if": "$matomo_version_check_major$"
10+
},
11+
"--check-minor": {
12+
"set_if": "$matomo_version_check_minor$"
13+
},
14+
"--check-patch": {
15+
"set_if": "$matomo_version_check_patch$"
16+
},
17+
"--insecure": {
18+
"set_if": "$matomo_version_insecure$"
19+
},
20+
"--no-proxy": {
21+
"set_if": "$matomo_version_no_proxy$"
22+
},
23+
"--offset-eol": {
24+
"value": "$matomo_version_offset_eol$"
1025
},
1126
"--path": {
1227
"value": "$matomo_version_path$"
28+
},
29+
"--timeout": {
30+
"value": "$matomo_version_timeout$"
1331
}
1432
},
1533
"command": "/usr/lib64/nagios/plugins/matomo-version",
@@ -29,6 +47,36 @@
2947
"datafield_id": 3,
3048
"is_required": "n",
3149
"var_filter": null
50+
},
51+
{
52+
"datafield_id": 4,
53+
"is_required": "n",
54+
"var_filter": null
55+
},
56+
{
57+
"datafield_id": 5,
58+
"is_required": "n",
59+
"var_filter": null
60+
},
61+
{
62+
"datafield_id": 6,
63+
"is_required": "n",
64+
"var_filter": null
65+
},
66+
{
67+
"datafield_id": 7,
68+
"is_required": "n",
69+
"var_filter": null
70+
},
71+
{
72+
"datafield_id": 8,
73+
"is_required": "n",
74+
"var_filter": null
75+
},
76+
{
77+
"datafield_id": 9,
78+
"is_required": "n",
79+
"var_filter": null
3280
}
3381
],
3482
"imports": [],
@@ -59,7 +107,7 @@
59107
"enable_flapping": null,
60108
"enable_notifications": true,
61109
"enable_passive_checks": null,
62-
"enable_perfdata": null,
110+
"enable_perfdata": true,
63111
"event_command": null,
64112
"fields": [],
65113
"flapping_threshold_high": null,
@@ -72,20 +120,26 @@
72120
"tpl-service-generic"
73121
],
74122
"max_check_attempts": 5,
75-
"notes": "This plugin lets you track if server updates are available.",
123+
"notes": "Tracks if Matomo is EOL.",
76124
"notes_url": "https://github.com/Linuxfabrik/monitoring-plugins/tree/main/check-plugins/matomo-version",
77125
"object_name": "tpl-service-matomo-version",
78126
"object_type": "template",
79-
"retry_interval": 3600,
127+
"retry_interval": 300,
80128
"service_set": null,
81129
"template_choice": null,
82130
"use_agent": null,
83131
"use_var_overrides": null,
84132
"vars": {
85133
"criticality": "C",
86134
"matomo_version_always_ok": false,
87-
"matomo_version_cache_expire": 24,
88-
"matomo_version_path": "/var/www/html/matomo"
135+
"matomo_version_check_major": false,
136+
"matomo_version_check_minor": false,
137+
"matomo_version_check_patch": false,
138+
"matomo_version_insecure": false,
139+
"matomo_version_no_proxy": false,
140+
"matomo_version_offset_eol": -30,
141+
"matomo_version_path": "/var/www/html/matomo",
142+
"matomo_version_timeout": 8
89143
},
90144
"volatile": null,
91145
"zone": null,
@@ -103,17 +157,62 @@
103157
"uuid": "c82972e6-2b6b-41ed-9d25-891a43cbf9d4"
104158
},
105159
"2": {
106-
"varname": "matomo_version_cache_expire",
107-
"caption": "Matomo Version: Cache Expire",
108-
"description": "The amount of time after which the update check cache expires, in hours.",
160+
"varname": "matomo_version_check_major",
161+
"caption": "Matomo Version: Check Major?",
162+
"description": "Alert me when there is a new major release available, even if the current version of my product is not EOL. Example: Notify when I run v26 (not yet EOL) and v27 is available.",
163+
"datatype": "Icinga\\Module\\Director\\DataType\\DataTypeBoolean",
164+
"format": null,
165+
"settings": {},
166+
"uuid": "79a50cf9-6b49-49c6-a43b-c979577107d2"
167+
},
168+
"3": {
169+
"varname": "matomo_version_check_minor",
170+
"caption": "Matomo Version: Check Minor?",
171+
"description": "Alert me when there is a new major.minor release available, even if the current version of my product is not EOL. Example: Notify when I run v26.2 (not yet EOL) and v26.3 is available.",
172+
"datatype": "Icinga\\Module\\Director\\DataType\\DataTypeBoolean",
173+
"format": null,
174+
"settings": {},
175+
"uuid": "6b140576-61d6-4030-bdca-b58070839d0c"
176+
},
177+
"4": {
178+
"varname": "matomo_version_check_patch",
179+
"caption": "Matomo Version: Check Patch?",
180+
"description": "Alert me when there is a new major.minor.patch release available, even if the current version of my product is not EOL. Example: Notify when I run v26.2.7 (not yet EOL) and v26.2.8 is available.",
181+
"datatype": "Icinga\\Module\\Director\\DataType\\DataTypeBoolean",
182+
"format": null,
183+
"settings": {},
184+
"uuid": "91ada52d-eee6-4783-8ac2-0d960648cafb"
185+
},
186+
"5": {
187+
"varname": "matomo_version_insecure",
188+
"caption": "Matomo Version: Insecure?",
189+
"description": "This option explicitly allows to perform \"insecure\" SSL connections.",
190+
"datatype": "Icinga\\Module\\Director\\DataType\\DataTypeBoolean",
191+
"format": null,
192+
"settings": {},
193+
"uuid": "27093ed0-357c-42c7-980a-5509becee7a5"
194+
},
195+
"6": {
196+
"varname": "matomo_version_no_proxy",
197+
"caption": "Matomo Version: No Proxy?",
198+
"description": "Do not use a proxy.",
199+
"datatype": "Icinga\\Module\\Director\\DataType\\DataTypeBoolean",
200+
"format": null,
201+
"settings": {},
202+
"uuid": "f57d21c5-0e31-473b-8e04-1194c36b9352"
203+
},
204+
"7": {
205+
"varname": "matomo_version_offset_eol",
206+
"caption": "Matomo Version: Offset Eol",
207+
"description": "Alert me n days before (\"-30\") or after an EOL date (\"30\" or \"+30\").",
109208
"datatype": "Icinga\\Module\\Director\\DataType\\DataTypeString",
110209
"format": null,
111210
"settings": {
112211
"visibility": "visible"
113212
},
114-
"uuid": "c91ff76f-9693-49dd-83a0-5fb1cf8a3bf6"
213+
"uuid": "c3118a6b-884f-44d4-bfe2-17c392897623"
115214
},
116-
"3": {
215+
"8": {
117216
"varname": "matomo_version_path",
118217
"caption": "Matomo Version: Path",
119218
"description": "Local path to your Matomo/Piwik installation, typically within your Webserver's Document Root.",
@@ -123,6 +222,17 @@
123222
"visibility": "visible"
124223
},
125224
"uuid": "ed35a177-80eb-4104-9545-4a90f600a31b"
225+
},
226+
"9": {
227+
"varname": "matomo_version_timeout",
228+
"caption": "Matomo Version: Timeout",
229+
"description": "Network timeout in seconds.",
230+
"datatype": "Icinga\\Module\\Director\\DataType\\DataTypeString",
231+
"format": null,
232+
"settings": {
233+
"visibility": "visible"
234+
},
235+
"uuid": "547e3c2a-36a3-48f8-afa3-54eaff46f623"
126236
}
127237
}
128238
}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
---
12
overwrites:
23
'["ServiceTemplate"]["tpl-service-matomo-version"]["check_interval"]': 86400
3-
'["ServiceTemplate"]["tpl-service-matomo-version"]["retry_interval"]': 3600
4+
'["ServiceTemplate"]["tpl-service-matomo-version"]["enable_perfdata"]': true
5+
'["ServiceTemplate"]["tpl-service-matomo-version"]["retry_interval"]': 300

0 commit comments

Comments
 (0)