Module: check_mk
Branch: master
Commit: 6af275c19a233dac24c8b2a024af9eec0a07e230
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6af275c19a233d…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Aug 18 18:15:34 2011 +0200
--snmpwalk: fix missing space in case of HEX strings
---
.bugs/151 | 10 +++++++---
ChangeLog | 3 +++
modules/check_mk.py | 7 ++++---
3 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/.bugs/151 b/.bugs/151
index f722057..b7396c1 100644
--- a/.bugs/151
+++ b/.bugs/151
@@ -1,13 +1,17 @@
Title: --snmpwalk garbles HEX strings
Component: core
+State: done
+Class: bug
+Date: 2011-02-18 09:58:05
Benefit: 1
-State: open
Cost: 2
-Date: 2011-02-18 09:58:05
-Class: bug
+Fun: 0
When doing a --snmpwalk if the target machine outputs multiline
HEX strings, the trailing spaces are stripped and thus hex codes
are glued together (202E instead of 20 2E). That way, the hex
string detection fails. This is probably in line 2731 of main.py:
the strip() should only strip trailing LF/CR, not spaces.
+
+2011-08-18 18:14:56: changed state open -> done
+Fixed. Problem was a strip() too much.
diff --git a/ChangeLog b/ChangeLog
index cafd9ac..c4da707 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
1.1.11i3:
+ Core, Setup, etc.:
+ * --snmpwalk: fix missing space in case of HEX strings
+
Checks & Agents:
* FIX: printer_pages: workaround for trailing-zero bug in HP Jetdirect
* mk_logwatch: allow to set limits in processing time and number of
diff --git a/modules/check_mk.py b/modules/check_mk.py
index b0af17b..105c518 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -2978,13 +2978,14 @@ def do_snmpwalk_on(hostname, filename):
line = f.readline()
if not line:
break
- parts = line.strip().split("=", 1)
+ parts = line.split("=", 1)
if len(parts) != 2:
continue
oid, value = parts
- if value.strip().startswith('"'):
+ value = value.rstrip("\n")
+ if value.lstrip().startswith('"'):
while value[-1] != '"':
- value += f.readline().strip()
+ value += f.readline().rstrip("\n")
if not oid.startswith("."):
oid = "." + oid