Skip to content

Commit

Permalink
Add grassfish-players, grassfish-screens
Browse files Browse the repository at this point in the history
  • Loading branch information
markuslf committed Mar 8, 2023
1 parent 3db4488 commit 5b2ca6e
Show file tree
Hide file tree
Showing 32 changed files with 3,821 additions and 10 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Icinga Director:
* Removed "oVirt VM Service Set (Windows Python)"
* Removed "oVirt VM Service Set (Windows)"
* Removed "PostgreSQL 9.6 Service Set"
* Removed duplicate tags "redhat7" and "redhat8", because there is also "rhel7" and "rhel8"
* Removed tags "redhat7" and "redhat8", because there are also "rhel7" and "rhel8"


### Added
Expand All @@ -54,6 +54,8 @@ Monitoring Plugins:
* crypto-policy
* csv-values
* grassfish-licenses
* grassfish-players
* grassfish-screens
* infomaniak-events
* journald-query
* journald-usage
Expand Down Expand Up @@ -300,7 +302,7 @@ Monitoring Plugins:

Icinga Director:

* Remove gpsvc on windows
* Remove gpsvc on Windows



Expand Down
2 changes: 1 addition & 1 deletion check-plugins/grassfish-licenses/grassfish-licenses3
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ from lib.globals3 import (STATE_OK, STATE_UNKNOWN, # pylint: disable=C0413
__author__ = 'Linuxfabrik GmbH, Zurich/Switzerland'
__version__ = '2023021701'

DESCRIPTION = """Warns if no more Grassfish licenses are available, using the Grassfish API.
DESCRIPTION = """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."""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
"tpl-service-generic"
],
"max_check_attempts": 5,
"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.",
"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.",
"notes_url": "https://github.com/Linuxfabrik/monitoring-plugins/tree/main/check-plugins/grassfish-licenses",
"object_name": "tpl-service-grassfish-licenses",
"object_type": "template",
Expand All @@ -202,7 +202,7 @@
"apply_for": null,
"assign_filter": null,
"check_command": "cmd-check-grassfish-licenses-windows",
"check_interval": 60,
"check_interval": 3600,
"check_period": null,
"check_timeout": null,
"command_endpoint": null,
Expand All @@ -213,7 +213,7 @@
"enable_flapping": null,
"enable_notifications": null,
"enable_passive_checks": null,
"enable_perfdata": null,
"enable_perfdata": true,
"event_command": null,
"fields": [],
"flapping_threshold_high": null,
Expand All @@ -226,14 +226,14 @@
"tpl-service-generic"
],
"max_check_attempts": 5,
"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.",
"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.",
"notes_url": "https://github.com/Linuxfabrik/monitoring-plugins/tree/main/check-plugins/grassfish-licenses",
"object_name": "tpl-service-grassfish-licenses-windows",
"object_type": "template",
"retry_interval": 15,
"retry_interval": 30,
"service_set": null,
"template_choice": null,
"use_agent": null,
"use_agent": false,
"use_var_overrides": null,
"vars": {
"grassfish_licenses_windows_always_ok": false,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
variants:
- linux
- windows
Expand All @@ -10,3 +9,8 @@ overwrites:
'["ServiceTemplate"]["tpl-service-grassfish-licenses"]["max_check_attempts"]': 5
'["ServiceTemplate"]["tpl-service-grassfish-licenses"]["retry_interval"]': 30
'["ServiceTemplate"]["tpl-service-grassfish-licenses"]["use_agent"]': false
'["ServiceTemplate"]["tpl-service-grassfish-licenses-windows"]["check_interval"]': 3600
'["ServiceTemplate"]["tpl-service-grassfish-licenses-windows"]["enable_perfdata"]': true
'["ServiceTemplate"]["tpl-service-grassfish-licenses-windows"]["max_check_attempts"]': 5
'["ServiceTemplate"]["tpl-service-grassfish-licenses-windows"]["retry_interval"]': 30
'["ServiceTemplate"]["tpl-service-grassfish-licenses-windows"]["use_agent"]': false
Empty file.
24 changes: 24 additions & 0 deletions check-plugins/grassfish-players/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org/>
133 changes: 133 additions & 0 deletions check-plugins/grassfish-players/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
Check grassfish-players
=======================

Overview
--------

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.

Tested with Grassfish v1.12.

Hints:

* May take more than 10 seconds to execute.


Fact Sheet
----------

.. csv-table::
:widths: 30, 70

"Check Plugin Download", "https://github.com/Linuxfabrik/monitoring-plugins/tree/main/check-plugins/grassfish-players"
"Check Interval Recommendation", "Once an hour"
"Can be called without parameters", "No"
"Available for", "Python 3, Windows"
"Requirements", "None"


Help
----

.. code-block:: text
usage: grassfish-players [-h] [-V] [--always-ok] [--api-version API_VERSION]
[--box-id BOX_ID]
[--box-state {activated,deleted,new,reserved,undefined}]
[--custom-id CUSTOM_ID] -H HOSTNAME
[--is-installed {yes,no}] [--is-licensed {yes,no}]
[--lengthy] [--port PORT] [--test TEST] --token
TOKEN [--transfer-status {complete,overdue,pending}]
[-w WARN] [-u URL]
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.
options:
-h, --help show this help message and exit
-V, --version show program's version number and exit
--always-ok Always returns OK.
--api-version API_VERSION
Grassfish API Version. Default: 1.12
--box-id BOX_ID Filter by specific box IDs. Supports Python Regular
Expressions (regex).
--box-state {activated,deleted,new,reserved,undefined}
Filter by specific box state. Repeating.
--custom-id CUSTOM_ID
Filter by specific custom IDs. Supports Python Regular
Expressions (regex).
-H HOSTNAME, --hostname HOSTNAME
Grassfish hostname. Default: None
--is-installed {yes,no}
Filter by boxes that are installed (= "yes") or not (=
"no"). Repeating.
--is-licensed {yes,no}
Filter by boxes that are licensed (= "yes") or not (=
"no"). Repeating.
--lengthy Extended reporting.
--port PORT Grassfish port. Default: 443
--test TEST For unit tests. Needs "path-to-stdout-file,path-to-
stderr-file,expected-retc".
--token TOKEN Grassfish API token
--transfer-status {complete,overdue,pending}
Filter by specific data transfer status. Repeating.
-w WARN, --warning WARN
Set the WARN threshold for Last Access in hours
(considers player is offline). Default: > 8 h
-u URL, --url URL Grassfish API URL. Default: /gv2/webservices/API
Usage Examples
--------------

.. code-block:: bash
./grassfish-players --hostname=ds.example.com --token=TOKEN --box-id=gp11
Output:

.. code-block:: text
There are 6 players with warnings: 2 unlicensed, 2 transfer overdue, 6 accessed > 10 hours ago. 6 players checked. Filter: --box-state=['activated']
Box ID ! License Type ! Name ! Box State ! Lic ! Transfer ! Last Access
----------+-------------------------+----------------------+-----------+-----------------+-------------------+--------------------------------------------
GP111-111 ! Player ! Grassfish Player 111 ! Activated ! True ! Complete ! 2020-03-09 14:07:53 (2Y 12M ago) [WARNING]
GP112-112 ! DsPlayerAdvancedSaas ! Grassfish Player 112 ! Activated ! True ! Pending ! 2020-03-09 14:07:53 (2Y 12M ago) [WARNING]
GP113-113 ! ColorDoorSignPlayerSaas ! Grassfish Player 113 ! Activated ! True ! Overdue [WARNING] ! 2020-03-09 14:07:53 (2Y 12M ago) [WARNING]
GP114-114 ! ColorDoorSignPlayerSaas ! Grassfish Player 114 ! Activated ! True ! Complete ! 2020-03-09 14:07:53 (2Y 12M ago) [WARNING]
GP115-115 ! ColorDoorSignPlayerSaas ! Grassfish Player 115 ! Activated ! False [WARNING] ! Complete ! 2020-03-09 14:07:53 (2Y 12M ago) [WARNING]
GP117-117 ! ColorDoorSignPlayerSaas ! Grassfish Player 117 ! Activated ! False [WARNING] ! Overdue [WARNING] ! 2020-03-09 14:07:53 (2Y 12M ago) [WARNING]
States
------

* WARN if player is not licensed
* WARN if player's transfer status is "Overdue"
* WARN if player's last access timestamp is > ``--warning`` hours (which considers player is offline)


Perfdata / Metrics
------------------

.. csv-table::
:widths: 25, 15, 60
:header-rows: 1

Name, Type, Description
grassfish_play_players, Number, Number of matching players found
grassfish_play_unlicensed, Number, Number of unlicensed players
grassfish_play_transfer_overdue, Number, Number of player with transfer status "Overdue"
grassfish_play_access_overdue, Number, Number of players with last access timestamp > ``--warning`` hours
grassfish_play_warnings, Number, grassfish_play_unlicensed + grassfish_play_transfer_overdue + grassfish_play_access_overdue


Credits, License
----------------

* Authors: `Linuxfabrik GmbH, Zurich <https://www.linuxfabrik.ch>`_
* License: The Unlicense, see `LICENSE file <https://unlicense.org/>`_.
26 changes: 26 additions & 0 deletions check-plugins/grassfish-players/examples/EXAMPLE01
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"Id": 111,
"Name": "Grassfish Player 111",
"CustomId": "GP1",
"LocationId": 1,
"EditionId": 1,
"ConfigurationGroupId": 1,
"BoxId": "GP111-111",
"LastAccess": "2020-03-09T14:07:53Z",
"LicenseType": "Player",
"TransferStatus": "Complete",
"IsInstalled": true,
"IsLicensed": true,
"Address": "MyAddress",
"PostCode": "111",
"City": "City",
"Country": "Country",
"TemperatureUnit": "Undefined",
"BoxState": "Activated",
"TimezoneId": 293,
"RootPasswordSet": false,
"Created": "2019-05-10T11:03:52Z",
"Modified": "2021-11-25T12:34:33Z"
}
]
26 changes: 26 additions & 0 deletions check-plugins/grassfish-players/examples/EXAMPLE02
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"Id": 112,
"Name": "Grassfish Player 112",
"CustomId": "GP1",
"LocationId": 1,
"EditionId": 1,
"ConfigurationGroupId": 1,
"BoxId": "GP112-112",
"LastAccess": "2020-03-09T14:07:53Z",
"LicenseType": "DsPlayerAdvancedSaas",
"TransferStatus": "Pending",
"IsInstalled": true,
"IsLicensed": true,
"Address": "MyAddress",
"PostCode": "112",
"City": "City",
"Country": "Country",
"TemperatureUnit": "Undefined",
"BoxState": "Activated",
"TimezoneId": 293,
"RootPasswordSet": false,
"Created": "2019-05-10T11:03:52Z",
"Modified": "2021-11-25T12:34:33Z"
}
]
26 changes: 26 additions & 0 deletions check-plugins/grassfish-players/examples/EXAMPLE03
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"Id": 113,
"Name": "Grassfish Player 113",
"CustomId": "GP1",
"LocationId": 1,
"EditionId": 1,
"ConfigurationGroupId": 1,
"BoxId": "GP113-113",
"LastAccess": "2020-03-09T14:07:53Z",
"LicenseType": "ColorDoorSignPlayerSaas",
"TransferStatus": "Overdue",
"IsInstalled": true,
"IsLicensed": true,
"Address": "MyAddress",
"PostCode": "113",
"City": "City",
"Country": "Country",
"TemperatureUnit": "Undefined",
"BoxState": "Activated",
"TimezoneId": 293,
"RootPasswordSet": false,
"Created": "2019-05-10T11:03:52Z",
"Modified": "2021-11-25T12:34:33Z"
}
]
26 changes: 26 additions & 0 deletions check-plugins/grassfish-players/examples/EXAMPLE04
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"Id": 114,
"Name": "Grassfish Player 114",
"CustomId": "GP1",
"LocationId": 1,
"EditionId": 1,
"ConfigurationGroupId": 1,
"BoxId": "GP114-114",
"LastAccess": "2020-03-09T14:07:53Z",
"LicenseType": "ColorDoorSignPlayerSaas",
"TransferStatus": "Complete",
"IsInstalled": false,
"IsLicensed": true,
"Address": "MyAddress",
"PostCode": "114",
"City": "City",
"Country": "Country",
"TemperatureUnit": "Undefined",
"BoxState": "Activated",
"TimezoneId": 293,
"RootPasswordSet": false,
"Created": "2019-05-10T11:03:52Z",
"Modified": "2021-11-25T12:34:33Z"
}
]
26 changes: 26 additions & 0 deletions check-plugins/grassfish-players/examples/EXAMPLE05
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"Id": 115,
"Name": "Grassfish Player 115",
"CustomId": "GP1",
"LocationId": 1,
"EditionId": 1,
"ConfigurationGroupId": 1,
"BoxId": "GP115-115",
"LastAccess": "2020-03-09T14:07:53Z",
"LicenseType": "ColorDoorSignPlayerSaas",
"TransferStatus": "Complete",
"IsInstalled": true,
"IsLicensed": false,
"Address": "MyAddress",
"PostCode": "115",
"City": "City",
"Country": "Country",
"TemperatureUnit": "Undefined",
"BoxState": "Activated",
"TimezoneId": 293,
"RootPasswordSet": false,
"Created": "2019-05-10T11:03:52Z",
"Modified": "2021-11-25T12:34:33Z"
}
]
Loading

0 comments on commit 5b2ca6e

Please sign in to comment.