Module: check_mk
Branch: master
Commit: 4a800f894f76a7029c4d7e47cb184911ac95dafe
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4a800f894f76a7…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Feb 21 15:44:22 2017 +0100
4407 FIX df: fixed handling of paths including spaces
Change-Id: Ifa0e803aaa41f47e2f6befa5d210376b494b2c9a
---
.werks/4407 | 11 +++++++++++
ChangeLog | 1 +
checks/df | 9 +++++++++
3 files changed, 21 insertions(+)
diff --git a/.werks/4407 b/.werks/4407
new file mode 100644
index 0000000..efed745
--- /dev/null
+++ b/.werks/4407
@@ -0,0 +1,11 @@
+Title: df: fixed handling of paths including spaces
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1487688209
+
+
diff --git a/ChangeLog b/ChangeLog
index c09b9ee..e7feeb8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,7 @@
* 4374 FIX: check_sql: Fixed exception in verbose mode when querying MSSQL...
* 4375 FIX: check_sql: Fixed reporting configuration issues to monitoring core...
* 4406 FIX: Fixed some invalid keyword arguments in check_info declarations...
+ * 4407 FIX: df: fixed handling of paths including spaces
* 4408 FIX: checkpoint_temp, checkpoint_fan, checkpoint_voltage: fixed status and
value handling
* 4349 FIX: cisco_qos: Fix crashing check for some cases where the QoS class cannot
be found...
* 4409 FIX: uptime: fixed missing info handling
diff --git a/checks/df b/checks/df
index f222dd9..2db54bf 100644
--- a/checks/df
+++ b/checks/df
@@ -85,6 +85,10 @@
# /dev/sda5 799680 118 799562 0% /persist
# [df_inodes_end]
+# <<<df>>>
+# C:\ NTFS 41838588 21776048 20062540 53% C:\
+# C:\Program Files\Vision
Solutions\Double-Take\Service\MountDir\usauhtest0010_c061b170-ad3f-473f-92ce-088c97fce98e_C\
NTFS 41835516 11895180 29940336 29% C:\Program Files\Vision
Solutions\Double-Take\Service\MountDir\usauhtest0010_c061b170-ad3f-473f-92ce-088c97fce98e_C\
+
def parse_df(info):
df_blocks = []
@@ -112,6 +116,11 @@ def parse_df(info):
if not is_inode:
# Handle known cases, where the file system contains spaces
+ for index, entry in enumerate(line):
+ if entry == "NTFS":
+ line = [ " ".join(line[:index]) ] + [line[index]] +
line[index+1:index+5] + [ " ".join(line[index+5:]) ]
+ break
+
if line[2] == "File" and line[3] == "System":
line = [ line[0], " ".join(line[1:4]) ] + line[4:]