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