Module: check_mk
Branch: master
Commit: c3c3e96a86ab09c340a5efad95f05b8cf2f99e67
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c3c3e96a86ab09…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Tue Aug 28 17:26:05 2018 +0200
6406 FIX df: fix a crash of the check if the inode count is '-'
Change-Id: Ib9cb3c21368ea961ba82dd7e058985c3c22a43fe
---
.werks/6406 | 10 ++++++++++
checks/df | 9 +++++++--
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/.werks/6406 b/.werks/6406
new file mode 100644
index 0000000..745b46b
--- /dev/null
+++ b/.werks/6406
@@ -0,0 +1,10 @@
+Title: df: fix a crash of the check if the inode count is '-'
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1535697589
+Class: fix
+
+
diff --git a/checks/df b/checks/df
index 9143903..a157f45 100644
--- a/checks/df
+++ b/checks/df
@@ -164,8 +164,13 @@ def parse_df(info):
pass
else:
line = [ line[0], None ] + line[1:]
- inodes_total = int(line[2])
- inodes_avail = int(line[4])
+
+ try:
+ inodes_total = int(line[2])
+ inodes_avail = int(line[4])
+ except ValueError:
+ continue
+
mountpoint = line[-1]
df_inodes.append((mountpoint, inodes_total, inodes_avail))
return df_inodes