]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/zabbix: fix health in non-compat mode 16580/head
authorSage Weil <sage@redhat.com>
Wed, 26 Jul 2017 02:57:12 +0000 (22:57 -0400)
committerSage Weil <sage@redhat.com>
Wed, 26 Jul 2017 02:57:12 +0000 (22:57 -0400)
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 <sage@redhat.com>
src/pybind/mgr/zabbix/module.py

index 9efb74c2ee0a7921d3b9ac6582de90abbf0eb647..1313ede4cc71beaaa2e11edd9b12bab1101b71ae 100644 (file)
@@ -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'])