summaryrefslogtreecommitdiffstats
path: root/contrib/munin/accounts.py
blob: 947989be5a529a9394df539ef304e64d1e109b7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import sys
from os.path import dirname, abspath
sys.path.append(dirname(dirname(dirname(abspath(__file__)))))

from account import *

if __name__ == "__main__":

    if len(sys.argv) > 1 and sys.argv[1] == 'config':
        print('graph_title Splinux')
        print('graph_vlabel Amount')
        print('accounts.label Accounts')
    else:
        service = AccountService(LDAP_HOST, LDAP_BASE_DN, SERVICES, LDAP_ADMIN_USER, LDAP_ADMIN_PASS)
        accounts = service.find()

        print('accounts.value %s' % len(accounts))