linotp.lib.monitoring module

library for monitoring controller

class linotp.lib.monitoring.MonitorHandler

Bases: object

provide functions for monitor controller

active_users_per_realm(realm=None)
get the number of users which are assigned to an active token in total

or per realm and resolver

Parameters

realm – name of realm

Returns

dict with keys: resolvernames values: number of active token users

active_users_total(realmlist)

get the total number of users of active tokens for all resolvers which are in allowed realms

users are counted per resolver, so if resolver is in more than one realm, its uers will only be counted once

Parameters

realmlist – list of (existing and allowed) realms

Returns

number of users in allowed realms who own an active token

check_encryption()

check if a value, which got written into config, got encrypted :return:

get_active_tokencount()

get the number of active tokens from all realms (including norealm)

Returns

number of active tokens

get_config_info()

get some counts from config db :return: dict with keys ‘total’, ‘ldapresolver’, ‘sqlresolver’,

‘passwdresolver’, ‘policies’, ‘realms’

get_sync_status()

check if cache and config db are synced

if sync is True, the synctime is returned else, the difference (cache-time - database_time) is given :return: dict with keys ‘sync’ and ‘synctime’

resolverinfo(realm)

get the resolvers for one realm and the number of users per resolver :param realm: the realm to query :return: dict with resolvernames as keys and number of users as value

token_count(realm_list, status=None)

Give the number of tokens (with status) per realm if multiple tokens are given, give summary for all tokens tokens which are in multiple realms are only counted once!

Parameters
  • realm_list – list of realms which must be queried

  • status – string which contains requested token status

Returns

dict with the keys: active, inactive, assigned, unassigned, total