Module: check_mk
Branch: master
Commit: 8586b33daa2e0fbed1f60c7e6f3861b2a074a2e8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8586b33daa2e0f…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Aug 19 18:27:38 2014 +0200
#1009 FIX df: deal with space in file system type for PlayStation file system
This inventory function of the check crashed when there was a filesystem
with a space in the filesystem type. We have seen one filesystem with
the type <tt>PlayStation(R)3 File System</tt>. This has been fixed now.
---
.werks/1009 | 12 ++++++++++++
ChangeLog | 2 +-
checks/df | 9 +++++++++
3 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/.werks/1009 b/.werks/1009
new file mode 100644
index 0000000..a446186
--- /dev/null
+++ b/.werks/1009
@@ -0,0 +1,12 @@
+Title: df: deal with space in file system type for PlayStation file system
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i6
+Date: 1408465511
+Class: fix
+
+This inventory function of the check crashed when there was a filesystem
+with a space in the filesystem type. We have seen one filesystem with
+the type <tt>PlayStation(R)3 File System</tt>. This has been fixed now.
+
diff --git a/ChangeLog b/ChangeLog
index 211fb13..33b061b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -40,6 +40,7 @@
* 0645 FIX: brocade_fcport: since in newer firmware (7.*) swFCPortSpeed is
deprecated, we then calculate port speed from IF-MIB::ifHighSpeed
* 0647 FIX: printer_input, printer_output: multiple fixes to algorithm for state
determination and inventory function...
* 1097 FIX: windows_agent: preventing missing agent sections on first query...
+ * 1009 FIX: df: deal with space in file system type for PlayStation file system...
Multisite:
* 1066 Implemented Dashboard Designer...
@@ -48,7 +49,6 @@
* 1154 FIX: Availability: Fixed unwanted redirect to edit annotation page after
editing availability options...
WATO:
- * 1095 New WATO Web-API: Now able to manage hosts via web automation calls
* 1096 New WATO webservices: manage hosts via webinterface...
* 1064 FIX: Fixed rare issue with WATO communication in distributed setups (different
OS versions)...
* 1089 FIX: Snapshot restore: fixed exception during exception handling......
diff --git a/checks/df b/checks/df
index 356a84e..de29914 100644
--- a/checks/df
+++ b/checks/df
@@ -31,6 +31,12 @@
# /dev/sda1 reiserfs 256666 16052 227362 7% /boot
# /dev/mapper/mirrored-database ext3 20642428 1027112 19405604 6%
/mirrored/database
+# Another example from a Windows 7 system:
+# <<<df>>>
+# SYSTEM NTFS 312569172 180648472 131920700 58% C:\
+# Data NTFS 976506816 528665344 447841472 55% D:\
+# PS3 PlayStation(R)3 File System 0 0 0 0% P:\
+
def df_parse_info(info):
df_blocks = []
df_inodes = []
@@ -46,6 +52,9 @@ def df_parse_info(info):
is_inode = False
continue
if not is_inode:
+ # Handle known cases, where the file system contains spaces
+ if line[2] == "File" and line[3] == "System":
+ line = [ line[0], " ".join(line[1:4]) ] + line[4:]
df_blocks.append(line)
else:
df_inodes.append(line)