munin: update for new tenants/ subdirectory
This commit is contained in:
parent
af4a5292d8
commit
18002c532f
|
@ -1,8 +1,11 @@
|
||||||
#! /usr/bin/env python
|
#! /usr/bin/env python
|
||||||
|
#%# family=auto
|
||||||
|
#%# capabilities=autoconf
|
||||||
|
|
||||||
import cPickle
|
import cPickle
|
||||||
import os
|
import os
|
||||||
import psycopg2
|
import psycopg2
|
||||||
|
import itertools
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
base_dir = None
|
base_dir = None
|
||||||
|
@ -27,8 +30,8 @@ count.label Count
|
||||||
|
|
||||||
total = 0
|
total = 0
|
||||||
|
|
||||||
for tenant in os.listdir(base_dir):
|
for tenant in itertools.chain(os.listdir(base_dir), os.listdir(os.path.join(base_dir, 'tenants')):
|
||||||
if tenant in ('collectstatic', 'scripts', 'skeletons', 'spooler'):
|
if tenant in ('collectstatic', 'scripts', 'skeletons', 'spooler', 'tenants'):
|
||||||
continue
|
continue
|
||||||
if tenant.endswith('.invalid'):
|
if tenant.endswith('.invalid'):
|
||||||
continue
|
continue
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
#! /usr/bin/env python
|
#! /usr/bin/env python
|
||||||
|
#%# family=auto
|
||||||
|
#%# capabilities=autoconf
|
||||||
|
|
||||||
import cPickle
|
import cPickle
|
||||||
|
import itertools
|
||||||
import os
|
import os
|
||||||
import psycopg2
|
import psycopg2
|
||||||
import sys
|
import sys
|
||||||
|
@ -29,7 +32,7 @@ total_logged_user_count.label Front by logged user
|
||||||
''' % tenant
|
''' % tenant
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
for tenant_dir in os.listdir(base_dir):
|
for tenant_dir in itertools.chain(os.listdir(base_dir), os.listdir(os.path.join(base_dir, 'tenants'))):
|
||||||
if tenant_dir != tenant:
|
if tenant_dir != tenant:
|
||||||
continue
|
continue
|
||||||
cfg = cPickle.load(open(os.path.join(base_dir, tenant, 'config.pck')))
|
cfg = cPickle.load(open(os.path.join(base_dir, tenant, 'config.pck')))
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#%# capabilities=autoconf
|
#%# capabilities=autoconf
|
||||||
|
|
||||||
import pickle
|
import pickle
|
||||||
|
import itertools
|
||||||
import datetime
|
import datetime
|
||||||
import os
|
import os
|
||||||
import psycopg2
|
import psycopg2
|
||||||
|
@ -38,8 +39,8 @@ time_5m = datetime.datetime.now() - datetime.timedelta(minutes=5)
|
||||||
time_1h = datetime.datetime.now() - datetime.timedelta(hours=1)
|
time_1h = datetime.datetime.now() - datetime.timedelta(hours=1)
|
||||||
time_1d = datetime.datetime.now() - datetime.timedelta(days=1)
|
time_1d = datetime.datetime.now() - datetime.timedelta(days=1)
|
||||||
|
|
||||||
for tenant in os.listdir(base_dir):
|
for tenant in itertools.chain(os.listdir(base_dir), os.listdir(os.path.join(base_dir, 'tenants'))):
|
||||||
if tenant in ('collectstatic', 'scripts', 'skeletons', 'spooler'):
|
if tenant in ('collectstatic', 'scripts', 'skeletons', 'spooler', 'tenants'):
|
||||||
continue
|
continue
|
||||||
if tenant.endswith('.invalid'):
|
if tenant.endswith('.invalid'):
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue