diff options
Diffstat (limited to 'contrib/munin/accounts.py')
-rwxr-xr-x[-rw-r--r--] | contrib/munin/accounts.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/contrib/munin/accounts.py b/contrib/munin/accounts.py index 947989b..684f278 100644..100755 --- a/contrib/munin/accounts.py +++ b/contrib/munin/accounts.py @@ -1,17 +1,23 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- import sys from os.path import dirname, abspath sys.path.append(dirname(dirname(dirname(abspath(__file__))))) -from account import * +from account import AccountService +from app import app if __name__ == "__main__": if len(sys.argv) > 1 and sys.argv[1] == 'config': - print('graph_title Splinux') - print('graph_vlabel Amount') + print('graph_title Spline Accounts') + print('graph_vlabel Number') print('accounts.label Accounts') else: - service = AccountService(LDAP_HOST, LDAP_BASE_DN, SERVICES, LDAP_ADMIN_USER, LDAP_ADMIN_PASS) + service = AccountService(app.config['LDAP_HOST'], app.config['LDAP_BASE_DN'], + app.config['LDAP_ADMIN_USER'], app.config['LDAP_ADMIN_PASS'], + app.all_services) + accounts = service.find() - print('accounts.value %s' % len(accounts)) + print('accounts.value %d' % len(accounts)) |