Module: check_mk
Branch: master
Commit: abef10a923cfee848463ac5a36c74b66a4f405a2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=abef10a923cfee…
Author: Marcel Arentz <ma(a)mathias-kettner.de>
Date: Wed Feb 8 14:38:32 2017 +0100
4192 FIX df: Fixed handling of incomplete information about inodes
The check will not crash anymore if the information about inodes are incomplete, e.g. if a value is "-".
Change-Id: I2139a0eff0014ef3de4e0d2365e9affa2dc1249a
---
.werks/4192 | 9 +++++++++
checks/df | 2 +-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/.werks/4192 b/.werks/4192
new file mode 100644
index 0000000..70962fd
--- /dev/null
+++ b/.werks/4192
@@ -0,0 +1,9 @@
+Title: df: Fixed handling of incomplete information about inodes
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i4
+Date: 1486560996
+Class: fix
+
+The check will not crash anymore if the information about inodes are incomplete, e.g. if a value is "-".
diff --git a/checks/df b/checks/df
index 8c6259a..f222dd9 100644
--- a/checks/df
+++ b/checks/df
@@ -171,7 +171,7 @@ def check_df(item, params, parsed):
used_mb = int(line[3]) / 1024.0
reserved_mb = size_mb - avail_mb - used_mb # reserved for root
fslist_blocks.append((mountpoint, size_mb, avail_mb, reserved_mb))
- if df_inodes and len(df_inodes) > idx:
+ if df_inodes and len(df_inodes) > idx and not "-" in df_inodes[idx]:
fslist_inodes.append((mountpoint, int(df_inodes[idx][2]), int(df_inodes[idx][4])))
return df_check_filesystem_list(item, params, fslist_blocks, fslist_inodes)