diff options
-rwxr-xr-x | nextcloud_multi | 11 | ||||
-rwxr-xr-x | nextcloud_users | 6 |
2 files changed, 11 insertions, 6 deletions
diff --git a/nextcloud_multi b/nextcloud_multi index c419ee1..da33225 100755 --- a/nextcloud_multi +++ b/nextcloud_multi @@ -40,7 +40,10 @@ class NextcloudMultiGraph: 'last1hour.min 0', 'last24hours.label last 24 hours', 'last24hours.info users connected in the last 24 hours', - 'last24hours.min 0' + 'last24hours.min 0', + 'num_users.label number of users', + 'num_users.info total number of users', + 'num_users.min 0' ], 'shares': [ 'multigraph nextcloud_shares', @@ -107,13 +110,17 @@ class NextcloudMultiGraph: } # users - users = api_response['ocs']['data']['activeUsers'] + users = api_response['ocs']['data']['activeUsers'] + num_users = api_response['ocs']['data']['nextcloud']['storage']['num_users'] data['nextcloud_users'].append('multigraph nextcloud_users') # append for every key in users the key and the value to the results [data['nextcloud_users'].append(str(key) + ".value " + str(users[key])) for key in users.keys()] + # append total number of users + data['nextcloud_users'].append('num_users.value %s' % num_users) + # shares shares = api_response['ocs']['data']['nextcloud']['shares'] data['nextcloud_shares'].append('multigraph nextcloud_shares') diff --git a/nextcloud_users b/nextcloud_users index f68543e..b2c651d 100755 --- a/nextcloud_users +++ b/nextcloud_users @@ -38,8 +38,6 @@ class NextcloudUsers: 'last24hours.min 0', 'num_users.label number of users', 'num_users.info total number of users', - 'num_users.min 0', - 'num_users.info total number of users', 'num_users.min 0' ] } @@ -52,13 +50,13 @@ class NextcloudUsers: } # users users = api_response['ocs']['data']['activeUsers'] + num_users = api_response['ocs']['data']['nextcloud']['storage']['num_users'] # append for every key in users the key and the value to the results [data['nextcloud_users'].append(str(key) + ".value " + str(users[key])) for key in users.keys()] - # storage - num_users = api_response['ocs']['data']['nextcloud']['storage']['num_users'] + # append total number of users data['nextcloud_users'].append('num_users.value %s' % num_users) return data |