From 582935f2223d770c084feb0f5cd5500ea22f86d7 Mon Sep 17 00:00:00 2001 From: Wido den Hollander Date: Mon, 26 Mar 2018 13:27:27 +0200 Subject: [PATCH] mgr/zabbix: Send max, min and avg PGs of OSDs to Zabbix We already send the max, min and avg fill ratio of OSDs but knowing the OSD with the highest amount of PGs is also useful. This allows admins to create a trigger should it happen that there is a OSD with too many PGs. This could happen if a lot of OSDs fail and PGs start to move filling up one or more OSDs with many PGs. As PGs eat CPU and Memory people usually like to watch out for these situations. Signed-off-by: Wido den Hollander --- src/pybind/mgr/zabbix/module.py | 5 + src/pybind/mgr/zabbix/zabbix_template.xml | 129 ++++++++++++++++++++++ 2 files changed, 134 insertions(+) diff --git a/src/pybind/mgr/zabbix/module.py b/src/pybind/mgr/zabbix/module.py index 84631cdc67b82..5377162b39f38 100644 --- a/src/pybind/mgr/zabbix/module.py +++ b/src/pybind/mgr/zabbix/module.py @@ -172,6 +172,7 @@ class Module(MgrModule): data['num_osd_in'] = num_in osd_fill = list() + osd_pgs = list() osd_apply_latency_ns = list() osd_commit_latency_ns = list() @@ -180,6 +181,7 @@ class Module(MgrModule): if osd['kb'] == 0: continue osd_fill.append((float(osd['kb_used']) / float(osd['kb'])) * 100) + osd_pgs.append(osd['num_pgs']) osd_apply_latency_ns.append(osd['perf_stat']['apply_latency_ns']) osd_commit_latency_ns.append(osd['perf_stat']['commit_latency_ns']) @@ -187,6 +189,9 @@ class Module(MgrModule): data['osd_max_fill'] = max(osd_fill) data['osd_min_fill'] = min(osd_fill) data['osd_avg_fill'] = avg(osd_fill) + data['osd_max_pgs'] = max(osd_pgs) + data['osd_min_pgs'] = min(osd_pgs) + data['osd_avg_pgs'] = avg(osd_pgs) except ValueError: pass diff --git a/src/pybind/mgr/zabbix/zabbix_template.xml b/src/pybind/mgr/zabbix/zabbix_template.xml index 0ad40027210ea..a2d1988341c09 100644 --- a/src/pybind/mgr/zabbix/zabbix_template.xml +++ b/src/pybind/mgr/zabbix/zabbix_template.xml @@ -367,6 +367,135 @@ + + Ceph OSD max PGs + 2 + + 0 + + ceph.osd_max_pgs + 0 + 90 + 365 + 0 + 0 + + + 0 + + + 0 + 0 + + 0 + + 1 + + + + 0 + 0 + + + + + + Maximum amount of PGs on OSDs + 0 + + + Ceph + + + + + + + Ceph OSD min PGs + 2 + + 0 + + ceph.osd_min_pgs + 0 + 90 + 365 + 0 + 0 + + + 0 + + + 0 + 0 + + 0 + + 1 + + + + 0 + 0 + + + + + + Minimum amount of PGs on OSDs + 0 + + + Ceph + + + + + + + Ceph OSD avg PGs + 2 + + 0 + + ceph.osd_avg_pgs + 0 + 90 + 365 + 0 + 0 + + + 0 + + + 0 + 0 + + 0 + + 1 + + + + 0 + 0 + + + + + + Average amount of PGs on OSDs + 0 + + + Ceph + + + + + Ceph backfill full ratio 2 -- 2.39.5