Module: check_mk
Branch: master
Commit: d502ea1a1f9058cc604c1814947c39f8dcdbf8a8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d502ea1a1f9058…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Jul 29 15:38:57 2014 +0200
#1090 FIX zfsget: fixed exception which happened on incomplete zfs entries
---
.werks/1090 | 9 +++++++++
ChangeLog | 1 +
checks/zfsget | 10 ++++++----
3 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/.werks/1090 b/.werks/1090
new file mode 100644
index 0000000..1204ab5
--- /dev/null
+++ b/.werks/1090
@@ -0,0 +1,9 @@
+Title: zfsget: fixed exception which happened on incomplete zfs entries
+Level: 1
+Component: checks
+Class: fix
+State: unknown
+Version: 1.2.5i6
+Date: 1406641044
+
+
diff --git a/ChangeLog b/ChangeLog
index 9316b4d..b9e0046 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
* 1065 heartbeat_crm / heartbeat_crm.resources: Rewrote checks / formalized
parameters...
* 1051 FIX: tcp_conn_stats: fix missing performance data...
* 1142 FIX: winperf_ts_sessions: fix computation, check has never really worked
+ * 1090 FIX: zfsget: fixed exception which happened on incomplete zfs entries
Multisite:
* 1066 Implemented Dashboard Designer...
diff --git a/checks/zfsget b/checks/zfsget
index f4b0ec5..a03564b 100644
--- a/checks/zfsget
+++ b/checks/zfsget
@@ -59,7 +59,7 @@
# tsrdb10exp 5128704 21 4982717 1% /tsrdb10exp
# tsrdb10dat 30707712 19914358 10789464 65% /u01
-def parse_zfs_entrie(info):
+def parse_zfs_entry(info):
def mb(x):
return saveint(x) / (1024.0 * 1024)
entry = {}
@@ -71,8 +71,8 @@ def parse_zfs_entrie(info):
entry[what] = mb(value)
elif what in [ 'mountpoint', 'type', 'name' ]:
entry[what] = value
- if entry:
- return entry
+
+ return entry
def parse_zfsget(info):
run_zfs = True
@@ -97,7 +97,9 @@ def parse_zfsget(info):
if last_name != name:
last_name = name
if zfs_agent_data:
- zfs_converted.append(parse_zfs_entrie(zfs_agent_data))
+ new_entry = parse_zfs_entry(zfs_agent_data)
+ if new_entry:
+ zfs_converted.append()
zfs_agent_data = []
zfs_agent_data.append(line[:3])