Module: check_mk
Branch: master
Commit: 26d4d5873e304bd89be61b4c6939c1db2888e152
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=26d4d5873e304b…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Mon Jan 15 10:05:01 2018 +0100
5615 FIX ceph_status: Fixed status handling if HEALTH_ERR occurs
Change-Id: Id93101a8591bc50c8c01096ac003e87c4d3862e7
---
.werks/5615 | 10 ++++++++++
checks/ceph_status | 7 +++++--
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/.werks/5615 b/.werks/5615
new file mode 100644
index 0000000..7614307
--- /dev/null
+++ b/.werks/5615
@@ -0,0 +1,10 @@
+Title: ceph_status: Fixed status handling if HEALTH_ERR occurs
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i3
+Date: 1516007045
+Class: fix
+
+
diff --git a/checks/ceph_status b/checks/ceph_status
index 7a5d979..6e69d64 100644
--- a/checks/ceph_status
+++ b/checks/ceph_status
@@ -80,10 +80,13 @@ def check_ceph_status(_no_item, params, parsed):
map_health_states = {
"HEALTH_OK" : (0, "OK"),
"HEALTH_WARN" : (1, "warning"),
- "HEALTH_CRIT" : (1, "critical"),
+ "HEALTH_CRIT" : (2, "critical"),
+ "HEALTH_ERR" : (2, "error"),
}
- state, state_readable =
map_health_states[parsed["health"]["overall_status"]]
+ overall_status = parsed["health"]["overall_status"]
+ state, state_readable = map_health_states.get(overall_status,
+ (3, "unknown[%s]" % overall_status))
yield state, 'Status: %s' % state_readable
yield ceph_check_epoch("ceph_status", parsed["election_epoch"],
params)