Module: check_mk
Branch: master
Commit: c12f0b81dbfc232bb125912f924074a94a767147
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c12f0b81dbfc23…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Mar 3 10:36:39 2017 +0100
ucs_bladecenter_faultinst: No longer reports UNKNWOWN when no fault instances are found
Change-Id: Ida6b14d4a1e7238740477f8225c9ecdce2680db2
---
.werks/4453 | 10 ++++++++++
checks/ucs_bladecenter_faultinst | 6 ++++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.werks/4453 b/.werks/4453
new file mode 100644
index 0000000..fd068e8
--- /dev/null
+++ b/.werks/4453
@@ -0,0 +1,10 @@
+Title: ucs_bladecenter_faultinst: No longer reports UNKNWOWN when no fault instances are
found
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1488533709
+Class: fix
+
+
diff --git a/checks/ucs_bladecenter_faultinst b/checks/ucs_bladecenter_faultinst
index ceb9b52..df614a5 100644
--- a/checks/ucs_bladecenter_faultinst
+++ b/checks/ucs_bladecenter_faultinst
@@ -49,10 +49,12 @@ def check_ucs_bladecenter_faultinst(item, _no_params, parsed):
severities.setdefault(entry_sev, [])
severities[entry_sev].append(values)
- state = 0
+ if not severities.items():
+ yield 0, "No fault instances found"
+ return
+
for sev, instances in severities.items():
sev_state = severity_map.get(sev, 3)
- state = max(state, sev_state)
# Right now, OK instances are also reported in detail
# If required we can increase the state level here, so that only WARN+ messages
are shown