summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2022-07-12 21:08:47 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2022-07-12 21:08:47 (GMT)
commit9a806d04fcc486b91cd6fb3c3673dd7c6b078109 (patch)
treefb743a0daccae3a431388d6a1f1b6c79af9acf9e
parentf0fec1582434c9218c3a76aef094cc511e353df1 (diff)
downloadmisc-fred-main.zip
misc-fred-main.tar.gz
misc-fred-main.tar.bz2
munin: update wcs counts for tenants/ subdirectoryHEADmain
-rwxr-xr-xmunin/publik_count7
-rwxr-xr-xmunin/publik_count_7
-rwxr-xr-xmunin/publik_recent_count7
3 files changed, 16 insertions, 5 deletions
diff --git a/munin/publik_count b/munin/publik_count
index 1d127b0..0c0d79b 100755
--- a/munin/publik_count
+++ b/munin/publik_count
@@ -35,9 +35,12 @@ for tenant in itertools.chain(os.listdir(base_dir), os.listdir(os.path.join(base
continue
if tenant.endswith('.invalid'):
continue
- if not os.path.isdir(os.path.join(base_dir, tenant)):
+ dirname = os.path.join(base_dir, tenant)
+ if not os.path.exists(dirname):
+ dirname = os.path.join(base_dir, 'tenants', tenant)
+ if not os.path.isdir(dirname):
continue
- cfg = pickle.load(open(os.path.join(base_dir, tenant, 'config.pck'), 'rb'), encoding='utf-8')
+ cfg = pickle.load(open(os.path.join(dirname, 'config.pck'), 'rb'), encoding='utf-8')
if 'postgresql' not in cfg:
continue
psql_cfg = {}
diff --git a/munin/publik_count_ b/munin/publik_count_
index 173c38c..14aa8d6 100755
--- a/munin/publik_count_
+++ b/munin/publik_count_
@@ -35,7 +35,12 @@ total_logged_user_count.label Front by logged user
for tenant_dir in itertools.chain(os.listdir(base_dir), os.listdir(os.path.join(base_dir, 'tenants'))):
if tenant_dir != tenant:
continue
- cfg = pickle.load(open(os.path.join(base_dir, tenant, 'config.pck'), 'rb'), encoding='utf-8')
+ dirname = os.path.join(base_dir, tenant)
+ if not os.path.exists(dirname):
+ dirname = os.path.join(base_dir, 'tenants', tenant)
+ if not os.path.isdir(dirname):
+ continue
+ cfg = pickle.load(open(os.path.join(dirname, 'config.pck'), 'rb'), encoding='utf-8')
if 'postgresql' not in cfg:
continue
psql_cfg = {}
diff --git a/munin/publik_recent_count b/munin/publik_recent_count
index 52c0361..f269feb 100755
--- a/munin/publik_recent_count
+++ b/munin/publik_recent_count
@@ -44,9 +44,12 @@ for tenant in itertools.chain(os.listdir(base_dir), os.listdir(os.path.join(base
continue
if tenant.endswith('.invalid'):
continue
- if not os.path.isdir(os.path.join(base_dir, tenant)):
+ dirname = os.path.join(base_dir, tenant)
+ if not os.path.exists(dirname):
+ dirname = os.path.join(base_dir, 'tenants', tenant)
+ if not os.path.isdir(dirname):
continue
- cfg = pickle.load(open(os.path.join(base_dir, tenant, 'config.pck'), 'rb'), encoding='utf-8')
+ cfg = pickle.load(open(os.path.join(dirname, 'config.pck'), 'rb'), encoding='utf-8')
if 'postgresql' not in cfg:
continue
psql_cfg = {}