Module: check_mk
Branch: master
Commit: f54cab52ac188b6e1134337133cf761d1693022f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f54cab52ac188b…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Apr 15 09:30:30 2015 +0200
#2202 FIX hr_fs: Remove Label:... from mount point, replace \ with /
This makes the filesystem check via SNMP kompatible with the one via
the Windows agent. Note: This change is incompatible since the item
names of the checks will change for Windows systems. You need to
rediscover in this case.
This does not affect Windows hosts that are monitored via the normal
Check_MK Agent.
---
.werks/2202 | 15 +++++++++++++++
ChangeLog | 2 ++
checks/hr_fs | 5 ++++-
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/.werks/2202 b/.werks/2202
new file mode 100644
index 0000000..848f94d
--- /dev/null
+++ b/.werks/2202
@@ -0,0 +1,15 @@
+Title: hr_fs: Remove Label:... from mount point, replace \ with /
+Level: 1
+Component: checks
+Compatible: incomp
+Version: 1.2.7i1
+Date: 1429082929
+Class: fix
+
+This makes the filesystem check via SNMP kompatible with the one via
+the Windows agent. Note: This change is incompatible since the item
+names of the checks will change for Windows systems. You need to
+rediscover in this case.
+
+This does not affect Windows hosts that are monitored via the normal
+Check_MK Agent.
diff --git a/ChangeLog b/ChangeLog
index f749720..c441a0f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -324,6 +324,8 @@
* 2198 FIX: windows_updates: Fix missing warning if reboot required in case forced
reboot is in the past...
* 1955 FIX: lnx_quota: Fixed status message to show the correct values of limits...
* 2064 FIX: windows agent: crash.log now uses \r\n as newline
+ * 2202 FIX: hr_fs: Remove Label:... from mount point, replace \ with /...
+ NOTE: Please refer to the migration notes!
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request,
added mailto link for error report...
diff --git a/checks/hr_fs b/checks/hr_fs
index 49c9bee..2e9bb33 100644
--- a/checks/hr_fs
+++ b/checks/hr_fs
@@ -27,9 +27,12 @@
# Juniper devices put information about the device into the
# field where we expect the mount point. Ugly. Remove that crap.
def fix_hr_fs_mountpoint(mp):
- mp = snmp_decode_string(mp)
+ mp = snmp_decode_string(mp).replace("\\", "/")
if "mounted on:" in mp:
return mp.rsplit(":",1)[-1].strip()
+ elif "Label:" in mp:
+ pos = mp.find("Label:")
+ return mp[:pos].rstrip()
else:
return mp