Skip to content

Commit 5b2ca6e

Browse files
committed
Add grassfish-players, grassfish-screens
1 parent 3db4488 commit 5b2ca6e

File tree

32 files changed

+3821
-10
lines changed

32 files changed

+3821
-10
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Icinga Director:
3939
* Removed "oVirt VM Service Set (Windows Python)"
4040
* Removed "oVirt VM Service Set (Windows)"
4141
* Removed "PostgreSQL 9.6 Service Set"
42-
* Removed duplicate tags "redhat7" and "redhat8", because there is also "rhel7" and "rhel8"
42+
* Removed tags "redhat7" and "redhat8", because there are also "rhel7" and "rhel8"
4343

4444

4545
### Added
@@ -54,6 +54,8 @@ Monitoring Plugins:
5454
* crypto-policy
5555
* csv-values
5656
* grassfish-licenses
57+
* grassfish-players
58+
* grassfish-screens
5759
* infomaniak-events
5860
* journald-query
5961
* journald-usage
@@ -300,7 +302,7 @@ Monitoring Plugins:
300302

301303
Icinga Director:
302304

303-
* Remove gpsvc on windows
305+
* Remove gpsvc on Windows
304306

305307

306308

check-plugins/grassfish-licenses/grassfish-licenses3

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ from lib.globals3 import (STATE_OK, STATE_UNKNOWN, # pylint: disable=C0413
2626
__author__ = 'Linuxfabrik GmbH, Zurich/Switzerland'
2727
__version__ = '2023021701'
2828

29-
DESCRIPTION = """Warns if no more Grassfish licenses are available, using the Grassfish API.
29+
DESCRIPTION = """Alerts if no more Grassfish licenses are available, using the Grassfish API.
3030
You must provide both the Grassfish hostname and a Grassfish token for this
3131
check to work."""
3232

check-plugins/grassfish-licenses/icingaweb2-module-director/grassfish-licenses.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
"tpl-service-generic"
179179
],
180180
"max_check_attempts": 5,
181-
"notes": "Warns if no more Grassfish licenses are available, using the Grassfish API. You must provide both the Grassfish hostname and a Grassfish token for this check to work.",
181+
"notes": "Alerts if no more Grassfish licenses are available, using the Grassfish API. You must provide both the Grassfish hostname and a Grassfish token for this check to work.",
182182
"notes_url": "https://github.com/Linuxfabrik/monitoring-plugins/tree/main/check-plugins/grassfish-licenses",
183183
"object_name": "tpl-service-grassfish-licenses",
184184
"object_type": "template",
@@ -202,7 +202,7 @@
202202
"apply_for": null,
203203
"assign_filter": null,
204204
"check_command": "cmd-check-grassfish-licenses-windows",
205-
"check_interval": 60,
205+
"check_interval": 3600,
206206
"check_period": null,
207207
"check_timeout": null,
208208
"command_endpoint": null,
@@ -213,7 +213,7 @@
213213
"enable_flapping": null,
214214
"enable_notifications": null,
215215
"enable_passive_checks": null,
216-
"enable_perfdata": null,
216+
"enable_perfdata": true,
217217
"event_command": null,
218218
"fields": [],
219219
"flapping_threshold_high": null,
@@ -226,14 +226,14 @@
226226
"tpl-service-generic"
227227
],
228228
"max_check_attempts": 5,
229-
"notes": "Warns if no more Grassfish licenses are available, using the Grassfish API. You must provide both the Grassfish hostname and a Grassfish token for this check to work.",
229+
"notes": "Alerts if no more Grassfish licenses are available, using the Grassfish API. You must provide both the Grassfish hostname and a Grassfish token for this check to work.",
230230
"notes_url": "https://github.com/Linuxfabrik/monitoring-plugins/tree/main/check-plugins/grassfish-licenses",
231231
"object_name": "tpl-service-grassfish-licenses-windows",
232232
"object_type": "template",
233-
"retry_interval": 15,
233+
"retry_interval": 30,
234234
"service_set": null,
235235
"template_choice": null,
236-
"use_agent": null,
236+
"use_agent": false,
237237
"use_var_overrides": null,
238238
"vars": {
239239
"grassfish_licenses_windows_always_ok": false,

check-plugins/grassfish-licenses/icingaweb2-module-director/grassfish-licenses.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
---
21
variants:
32
- linux
43
- windows
@@ -10,3 +9,8 @@ overwrites:
109
'["ServiceTemplate"]["tpl-service-grassfish-licenses"]["max_check_attempts"]': 5
1110
'["ServiceTemplate"]["tpl-service-grassfish-licenses"]["retry_interval"]': 30
1211
'["ServiceTemplate"]["tpl-service-grassfish-licenses"]["use_agent"]': false
12+
'["ServiceTemplate"]["tpl-service-grassfish-licenses-windows"]["check_interval"]': 3600
13+
'["ServiceTemplate"]["tpl-service-grassfish-licenses-windows"]["enable_perfdata"]': true
14+
'["ServiceTemplate"]["tpl-service-grassfish-licenses-windows"]["max_check_attempts"]': 5
15+
'["ServiceTemplate"]["tpl-service-grassfish-licenses-windows"]["retry_interval"]': 30
16+
'["ServiceTemplate"]["tpl-service-grassfish-licenses-windows"]["use_agent"]': false

check-plugins/grassfish-players/.windows

Whitespace-only changes.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
This is free and unencumbered software released into the public domain.
2+
3+
Anyone is free to copy, modify, publish, use, compile, sell, or
4+
distribute this software, either in source code form or as a compiled
5+
binary, for any purpose, commercial or non-commercial, and by any
6+
means.
7+
8+
In jurisdictions that recognize copyright laws, the author or authors
9+
of this software dedicate any and all copyright interest in the
10+
software to the public domain. We make this dedication for the benefit
11+
of the public at large and to the detriment of our heirs and
12+
successors. We intend this dedication to be an overt act of
13+
relinquishment in perpetuity of all present and future rights to this
14+
software under copyright law.
15+
16+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19+
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21+
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22+
OTHER DEALINGS IN THE SOFTWARE.
23+
24+
For more information, please refer to <http://unlicense.org/>
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
Check grassfish-players
2+
=======================
3+
4+
Overview
5+
--------
6+
7+
The Grassfish Platform offers a unified way to manage Digital Signage touchpoints. This monitoring plugin shows you a list of Grassfish players whose data transfer status is overdue, whose last access date is more than ``--warning`` hours ago or who are unlicensed. The list of players can be filtered. You must provide both the Grassfish hostname and a Grassfish token for this check to work.
8+
9+
Tested with Grassfish v1.12.
10+
11+
Hints:
12+
13+
* May take more than 10 seconds to execute.
14+
15+
16+
Fact Sheet
17+
----------
18+
19+
.. csv-table::
20+
:widths: 30, 70
21+
22+
"Check Plugin Download", "https://github.com/Linuxfabrik/monitoring-plugins/tree/main/check-plugins/grassfish-players"
23+
"Check Interval Recommendation", "Once an hour"
24+
"Can be called without parameters", "No"
25+
"Available for", "Python 3, Windows"
26+
"Requirements", "None"
27+
28+
29+
Help
30+
----
31+
32+
.. code-block:: text
33+
34+
usage: grassfish-players [-h] [-V] [--always-ok] [--api-version API_VERSION]
35+
[--box-id BOX_ID]
36+
[--box-state {activated,deleted,new,reserved,undefined}]
37+
[--custom-id CUSTOM_ID] -H HOSTNAME
38+
[--is-installed {yes,no}] [--is-licensed {yes,no}]
39+
[--lengthy] [--port PORT] [--test TEST] --token
40+
TOKEN [--transfer-status {complete,overdue,pending}]
41+
[-w WARN] [-u URL]
42+
43+
This monitoring plugin shows you a list of Grassfish players whose data
44+
transfer status is overdue, whose last access date is more than `--warning`
45+
hours ago or who are unlicensed. The list of players can be filtered. You must
46+
provide both the Grassfish hostname and a Grassfish token for this check to
47+
work.
48+
49+
options:
50+
-h, --help show this help message and exit
51+
-V, --version show program's version number and exit
52+
--always-ok Always returns OK.
53+
--api-version API_VERSION
54+
Grassfish API Version. Default: 1.12
55+
--box-id BOX_ID Filter by specific box IDs. Supports Python Regular
56+
Expressions (regex).
57+
--box-state {activated,deleted,new,reserved,undefined}
58+
Filter by specific box state. Repeating.
59+
--custom-id CUSTOM_ID
60+
Filter by specific custom IDs. Supports Python Regular
61+
Expressions (regex).
62+
-H HOSTNAME, --hostname HOSTNAME
63+
Grassfish hostname. Default: None
64+
--is-installed {yes,no}
65+
Filter by boxes that are installed (= "yes") or not (=
66+
"no"). Repeating.
67+
--is-licensed {yes,no}
68+
Filter by boxes that are licensed (= "yes") or not (=
69+
"no"). Repeating.
70+
--lengthy Extended reporting.
71+
--port PORT Grassfish port. Default: 443
72+
--test TEST For unit tests. Needs "path-to-stdout-file,path-to-
73+
stderr-file,expected-retc".
74+
--token TOKEN Grassfish API token
75+
--transfer-status {complete,overdue,pending}
76+
Filter by specific data transfer status. Repeating.
77+
-w WARN, --warning WARN
78+
Set the WARN threshold for Last Access in hours
79+
(considers player is offline). Default: > 8 h
80+
-u URL, --url URL Grassfish API URL. Default: /gv2/webservices/API
81+
82+
83+
Usage Examples
84+
--------------
85+
86+
.. code-block:: bash
87+
88+
./grassfish-players --hostname=ds.example.com --token=TOKEN --box-id=gp11
89+
90+
Output:
91+
92+
.. code-block:: text
93+
94+
There are 6 players with warnings: 2 unlicensed, 2 transfer overdue, 6 accessed > 10 hours ago. 6 players checked. Filter: --box-state=['activated']
95+
96+
Box ID ! License Type ! Name ! Box State ! Lic ! Transfer ! Last Access
97+
----------+-------------------------+----------------------+-----------+-----------------+-------------------+--------------------------------------------
98+
GP111-111 ! Player ! Grassfish Player 111 ! Activated ! True ! Complete ! 2020-03-09 14:07:53 (2Y 12M ago) [WARNING]
99+
GP112-112 ! DsPlayerAdvancedSaas ! Grassfish Player 112 ! Activated ! True ! Pending ! 2020-03-09 14:07:53 (2Y 12M ago) [WARNING]
100+
GP113-113 ! ColorDoorSignPlayerSaas ! Grassfish Player 113 ! Activated ! True ! Overdue [WARNING] ! 2020-03-09 14:07:53 (2Y 12M ago) [WARNING]
101+
GP114-114 ! ColorDoorSignPlayerSaas ! Grassfish Player 114 ! Activated ! True ! Complete ! 2020-03-09 14:07:53 (2Y 12M ago) [WARNING]
102+
GP115-115 ! ColorDoorSignPlayerSaas ! Grassfish Player 115 ! Activated ! False [WARNING] ! Complete ! 2020-03-09 14:07:53 (2Y 12M ago) [WARNING]
103+
GP117-117 ! ColorDoorSignPlayerSaas ! Grassfish Player 117 ! Activated ! False [WARNING] ! Overdue [WARNING] ! 2020-03-09 14:07:53 (2Y 12M ago) [WARNING]
104+
105+
106+
States
107+
------
108+
109+
* WARN if player is not licensed
110+
* WARN if player's transfer status is "Overdue"
111+
* WARN if player's last access timestamp is > ``--warning`` hours (which considers player is offline)
112+
113+
114+
Perfdata / Metrics
115+
------------------
116+
117+
.. csv-table::
118+
:widths: 25, 15, 60
119+
:header-rows: 1
120+
121+
Name, Type, Description
122+
grassfish_play_players, Number, Number of matching players found
123+
grassfish_play_unlicensed, Number, Number of unlicensed players
124+
grassfish_play_transfer_overdue, Number, Number of player with transfer status "Overdue"
125+
grassfish_play_access_overdue, Number, Number of players with last access timestamp > ``--warning`` hours
126+
grassfish_play_warnings, Number, grassfish_play_unlicensed + grassfish_play_transfer_overdue + grassfish_play_access_overdue
127+
128+
129+
Credits, License
130+
----------------
131+
132+
* Authors: `Linuxfabrik GmbH, Zurich <https://www.linuxfabrik.ch>`_
133+
* License: The Unlicense, see `LICENSE file <https://unlicense.org/>`_.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[
2+
{
3+
"Id": 111,
4+
"Name": "Grassfish Player 111",
5+
"CustomId": "GP1",
6+
"LocationId": 1,
7+
"EditionId": 1,
8+
"ConfigurationGroupId": 1,
9+
"BoxId": "GP111-111",
10+
"LastAccess": "2020-03-09T14:07:53Z",
11+
"LicenseType": "Player",
12+
"TransferStatus": "Complete",
13+
"IsInstalled": true,
14+
"IsLicensed": true,
15+
"Address": "MyAddress",
16+
"PostCode": "111",
17+
"City": "City",
18+
"Country": "Country",
19+
"TemperatureUnit": "Undefined",
20+
"BoxState": "Activated",
21+
"TimezoneId": 293,
22+
"RootPasswordSet": false,
23+
"Created": "2019-05-10T11:03:52Z",
24+
"Modified": "2021-11-25T12:34:33Z"
25+
}
26+
]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[
2+
{
3+
"Id": 112,
4+
"Name": "Grassfish Player 112",
5+
"CustomId": "GP1",
6+
"LocationId": 1,
7+
"EditionId": 1,
8+
"ConfigurationGroupId": 1,
9+
"BoxId": "GP112-112",
10+
"LastAccess": "2020-03-09T14:07:53Z",
11+
"LicenseType": "DsPlayerAdvancedSaas",
12+
"TransferStatus": "Pending",
13+
"IsInstalled": true,
14+
"IsLicensed": true,
15+
"Address": "MyAddress",
16+
"PostCode": "112",
17+
"City": "City",
18+
"Country": "Country",
19+
"TemperatureUnit": "Undefined",
20+
"BoxState": "Activated",
21+
"TimezoneId": 293,
22+
"RootPasswordSet": false,
23+
"Created": "2019-05-10T11:03:52Z",
24+
"Modified": "2021-11-25T12:34:33Z"
25+
}
26+
]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[
2+
{
3+
"Id": 113,
4+
"Name": "Grassfish Player 113",
5+
"CustomId": "GP1",
6+
"LocationId": 1,
7+
"EditionId": 1,
8+
"ConfigurationGroupId": 1,
9+
"BoxId": "GP113-113",
10+
"LastAccess": "2020-03-09T14:07:53Z",
11+
"LicenseType": "ColorDoorSignPlayerSaas",
12+
"TransferStatus": "Overdue",
13+
"IsInstalled": true,
14+
"IsLicensed": true,
15+
"Address": "MyAddress",
16+
"PostCode": "113",
17+
"City": "City",
18+
"Country": "Country",
19+
"TemperatureUnit": "Undefined",
20+
"BoxState": "Activated",
21+
"TimezoneId": 293,
22+
"RootPasswordSet": false,
23+
"Created": "2019-05-10T11:03:52Z",
24+
"Modified": "2021-11-25T12:34:33Z"
25+
}
26+
]

0 commit comments

Comments
 (0)