From: Sage Weil Date: Wed, 26 Jul 2017 02:57:12 +0000 (-0400) Subject: pybind/mgr/zabbix: fix health in non-compat mode X-Git-Tag: v12.1.2~104^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F16580%2Fhead;p=ceph.git pybind/mgr/zabbix: fix health in non-compat mode This was apparently written/tested with mon_health_preluminous_compat enabled. Fix to behave with or without that option. Fixes: http://tracker.ceph.com/issues/20767 Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/zabbix/module.py b/src/pybind/mgr/zabbix/module.py index 9efb74c2ee0a..1313ede4cc71 100644 --- a/src/pybind/mgr/zabbix/module.py +++ b/src/pybind/mgr/zabbix/module.py @@ -113,7 +113,9 @@ class Module(MgrModule): data = dict() health = json.loads(self.get('health')['json']) - data['overall_status'] = health['overall_status'] + # 'status' is luminous+, 'overall_status' is legacy mode. + data['overall_status'] = health.get('status', + health.get('overall_status')) data['overall_status_int'] = \ self.ceph_health_mapping.get(data['overall_status'])