Skip to content

Commit 91cf835

Browse files
committed
refactor(rocketchat-version): use EOL library
1 parent adf8628 commit 91cf835

5 files changed

Lines changed: 300 additions & 123 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ Monitoring Plugins:
140140
* openstack-nova-list: No more need for keystoneauth and keystoneclient
141141
* redis-status: Add `--tls` parameter
142142
* rhel-version: `--extended-support` checks for "Extended Life Cycle Support" EOL ([#740](https://github.com/Linuxfabrik/monitoring-plugins/issues/740))
143+
* rocketchat-version: use EOL library, parameter `--cache-expire` is deprecated
143144
* systemd-unit: Improve output
144145
* uptime: Report downtime ([#191](https://github.com/Linuxfabrik/monitoring-plugins/issues/191))
145146

check-plugins/rocketchat-version/README.rst

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

7-
This plugin lets you track if a Rocket.Chat server update is available. To check for updates, this plugin uses the Git Repo at https://github.com/RocketChat/Rocket.Chat/releases. To compare against the current/installed version of Rocket.Chat, the check needs URL/API access to the Rocket.Chat server.
7+
This plugin lets you track if Rocket.Chat is End-of-Life (EOL). To compare against the current/installed version of Rocket.Chat, the check needs URL/API access to the Rocket.Chat server.
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
@@ -18,35 +20,46 @@ Fact Sheet
1820
"Can be called without parameters", "No"
1921
"Compiled for", "Linux, Windows"
2022
"Requirements", "Requires a user with strong password and 'view-statistics' permission (only)."
21-
"Uses SQLite DBs", "Yes"
23+
"Uses SQLite DBs", "``$TEMP/linuxfabrik-lib-version.db``"
2224

2325

2426
Help
2527
----
2628

2729
.. code-block:: text
2830
29-
usage: rocketchat-version [-h] [-V] [--always-ok]
30-
[--cache-expire CACHE_EXPIRE] [--insecure]
31-
[--no-proxy] -p PASSWORD [--timeout TIMEOUT]
32-
[--url URL] --username USERNAME
31+
usage: rocketchat-version [-h] [-V] [--always-ok] [--check-major]
32+
[--check-minor] [--check-patch] [--insecure]
33+
[--no-proxy] [--offset-eol OFFSET_EOL] -p PASSWORD
34+
[--timeout TIMEOUT] [--url URL] --username USERNAME
3335
34-
This plugin lets you track if server updates are available. Requires a user
35-
with strong password and "view-statistics" permission (only).
36+
Tracks if Rocket.Chat is EOL.
3637
3738
options:
3839
-h, --help show this help message and exit
3940
-V, --version show program's version number and exit
4041
--always-ok Always returns OK.
41-
--cache-expire CACHE_EXPIRE
42-
The amount of time after which the update check cache
43-
expires, in hours. Default: 24
42+
--check-major Alert me when there is a new major release available,
43+
even if the current version of my product is not EOL.
44+
Example: Notify when I run v26 (not yet EOL) and v27
45+
is available. Default: False
46+
--check-minor Alert me when there is a new major.minor release
47+
available, even if the current version of my product
48+
is not EOL. Example: Notify when I run v26.2 (not yet
49+
EOL) and v26.3 is available. Default: False
50+
--check-patch Alert me when there is a new major.minor.patch release
51+
available, even if the current version of my product
52+
is not EOL. Example: Notify when I run v26.2.7 (not
53+
yet EOL) and v26.2.8 is available. Default: False
4454
--insecure This option explicitly allows to perform "insecure"
4555
SSL connections. Default: False
4656
--no-proxy Do not use a proxy. Default: False
57+
--offset-eol OFFSET_EOL
58+
Alert me n days before ("-30") or after an EOL date
59+
("30" or "+30"). Default: -30 days
4760
-p, --password PASSWORD
4861
Rocket.Chat API password.
49-
--timeout TIMEOUT Network timeout in seconds. Default: 3 (seconds)
62+
--timeout TIMEOUT Network timeout in seconds. Default: 8 (seconds)
5063
--url URL Rocket.Chat API URL. Default:
5164
http://localhost:3000/api/v1
5265
--username USERNAME Rocket.Chat API username. Default: rocket-stats
@@ -57,26 +70,33 @@ Usage Examples
5770

5871
.. code-block:: bash
5972
60-
./rocketchat-version --username rocket-stats --password mypassword --url http://rocket:3000/api/v1 --cache-expire 8 --always-ok
61-
73+
./rocketchat-version --username rocket-stats --password mypassword --url http://rocket:3000/api/v1 --offset-eol=-30
74+
6275
Output:
6376

6477
.. code-block:: text
6578
66-
Rocket.Chat v6.6.2 installed, Rocket.Chat v6.6.3 available
79+
Rocket.Chat v6.13.0 (full support ended on 2024-10-10; EOL 2025-04-30 -30d, major 7.4.0 available, patch 6.13.1 available)
6780
6881
6982
States
7083
------
7184

72-
* If wanted, always returns OK,
73-
* else returns WARN if update is available.
85+
* WARN if software is EOL
86+
* Optional: WARN when new major version is available
87+
* Optional: WARN when new minor version is available
88+
* Optional: WARN when new patch version is available
7489

7590

7691
Perfdata / Metrics
7792
------------------
7893

79-
There is no perfdata.
94+
.. csv-table::
95+
:widths: 25, 15, 60
96+
:header-rows: 1
97+
98+
Name, Type, Description
99+
rocketchat-version, Number, Installed Rocket.Chat version as float. "6.13.1" becomes "6.131".
80100

81101

82102
Credits, License

0 commit comments

Comments
 (0)