Skip to content

Commit 42a3490

Browse files
committed
refactor(rocketchat-stats): improve output
1 parent 7f743b5 commit 42a3490

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ Monitoring Plugins:
5959
* nextcloud-version: modernize code
6060
* php-status: always assume http://localhost/monitoring.php and, if not found, be tolerant
6161
* redis-status, valkey-status: modernize code and unify both plugins again after [PR #954](https://github.com/Linuxfabrik/monitoring-plugins/pull/954)
62+
* rocketchat-stats: improve output
6263
* updates: adapt to updated powershell.py library
6364

6465

check-plugins/rocketchat-stats/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ Output:
5959
* Users: 325 total, 8 online, 0 busy, 1 away, 316 offline
6060
* Types and Distribution: 9 connected, 223 activated users, 0 activated guests, 100 deactivated users, 2 Rocket.Chat app users
6161
* Total Uploads: 6285, 4.3GiB size
62-
* Total Rooms: 672 rooms, 1 channel, 96 private groups, 440 direct msg rooms, 0 discussions, 135 omnichannel rooms
63-
* Total Messages: 295.2K, 829 threads, 5 in channels, 178.3K in priv groups, 115.0K in direct msg, 1.9K in omnichannel
62+
* Total Rooms: 672 (1 channel, 96 private groups, 440 direct msg rooms, 0 discussions, 135 omnichannel rooms)
63+
* Total Messages: 295.2K (829 threads, 5 in channels, 178.3K in priv groups, 115.0K in direct msg, 1.9K in omnichannel)
6464
```
6565

6666

check-plugins/rocketchat-stats/rocketchat-stats

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import lib.rocket # pylint: disable=C0413
2020
from lib.globals import (STATE_OK, STATE_UNKNOWN) # pylint: disable=C0413
2121

2222
__author__ = 'Linuxfabrik GmbH, Zurich/Switzerland'
23-
__version__ = '2025100601'
23+
__version__ = '2025112601'
2424

2525
DESCRIPTION = """This plugin allows you to track statistics about a Rocket.Chat server,
2626
structured in the same way as on the https://rocket.chat/admin/info page.
@@ -171,9 +171,8 @@ def main():
171171
lib.human.bytes2human(result.get('uploadsTotalSize', 0)),
172172
)
173173

174-
msg += '\n* Total Rooms: {} ({}, {} {}, {} private {}, {} direct msg {}, {} {}, {} omnichannel {})'.format( # pylint: disable=C0301
174+
msg += '\n* Total Rooms: {} ({} {}, {} private {}, {} direct msg {}, {} {}, {} omnichannel {})'.format( # pylint: disable=C0301
175175
result.get('totalRooms', 'n/a'),
176-
lib.txt.pluralize('room', result.get('totalRooms', 0)),
177176
result.get('totalChannels', 'n/a'),
178177
lib.txt.pluralize('channel', result.get('totalChannels', 0)),
179178
result.get('totalPrivateGroups', 'n/a'),
@@ -186,7 +185,7 @@ def main():
186185
lib.txt.pluralize('room', result.get('totalLivechat', 0)),
187186
)
188187

189-
msg += '\n* Total Messages: {}, {} {}, {} in channels, {} in priv groups, {} in direct msg, {} in omnichannel'.format( # pylint: disable=C0301
188+
msg += '\n* Total Messages: {} ({} {}, {} in channels, {} in priv groups, {} in direct msg, {} in omnichannel)'.format( # pylint: disable=C0301
190189
lib.human.number2human(result.get('totalMessages', 0)),
191190
result.get('totalThreads', 'n/a'),
192191
lib.txt.pluralize('thread', result.get('totalThreads', 0)),

0 commit comments

Comments
 (0)