Module: check_mk
Branch: master
Commit: 1fc70e65f80cfd79da72f66344d0c0319733a39c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1fc70e65f80cfd…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Mon Nov 20 08:42:01 2017 +0100
5548 FIX zpool_status: Fixed crash if pool has been deleted or vanished
The service would crash if a previously detected pool has been removed/deleted
or vanished for some reasons. This is now fixed and the service output will
reflect that no pool is available.
Change-Id: Id55b02802f69893e9949775e92b497910d99e1fe
---
.werks/5548 | 12 ++++++++++++
checks/zpool_status | 2 ++
2 files changed, 14 insertions(+)
diff --git a/.werks/5548 b/.werks/5548
new file mode 100644
index 0000000..9b1949e
--- /dev/null
+++ b/.werks/5548
@@ -0,0 +1,12 @@
+Title: zpool_status: Fixed crash if pool has been deleted or vanished
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1511163595
+Class: fix
+
+The service would crash if a previously detected pool has been removed/deleted
+or vanished for some reasons. This is now fixed and the service output will
+reflect that no pool is available.
diff --git a/checks/zpool_status b/checks/zpool_status
index f0cbfe4..a700226 100644
--- a/checks/zpool_status
+++ b/checks/zpool_status
@@ -71,6 +71,8 @@ def inventory_zpool_status(info):
def check_zpool_status(_no_item, _no_params, info):
if " ".join(info[0]) == "all pools are healthy":
return 0, "All pools are healthy"
+ elif " ".join(info[0]) == "no pools available":
+ return 3, "No pools available"
start_pool = False
multiline = False