Module: check_mk
Branch: master
Commit: 6f6783023701f2226a79944c7936d5b1b3a56bba
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6f6783023701f2…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Dec 9 17:09:18 2014 +0100
#1750 FIX Handle rare cases where SNMP response string begins with a line feed
The SNMP engine von Check_MK already handled the case correctly that a string
contains newlines. But the rare case that it <i>started</i> with a newline
was not handled correctly. This has been fixed now.
---
.werks/1750 | 11 +++++++++++
ChangeLog | 1 +
modules/snmp.py | 2 +-
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/.werks/1750 b/.werks/1750
new file mode 100644
index 0000000..eac8470
--- /dev/null
+++ b/.werks/1750
@@ -0,0 +1,11 @@
+Title: Handle rare cases where SNMP response string begins with a line feed
+Level: 1
+Component: core
+Compatible: compat
+Version: 1.2.5i7
+Date: 1418141289
+Class: fix
+
+The SNMP engine von Check_MK already handled the case correctly that a string
+contains newlines. But the rare case that it <i>started</i> with a newline
+was not handled correctly. This has been fixed now.
diff --git a/ChangeLog b/ChangeLog
index b2bae67..40944d3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,7 @@
* 1628 FIX: Remove trailing backslashes from service descriptions...
* 1649 FIX: Check_MK inventory service has been renamed to Check_MK Discovery...
* 1706 FIX: Fix file permissions when installing MKPs to 0644 or 0755...
+ * 1750 FIX: Handle rare cases where SNMP response string begins with a line feed...
Checks & Agents:
* 1197 climaveneta_temp: New check for temperature sensors on Climaveneta clima
devices
diff --git a/modules/snmp.py b/modules/snmp.py
index d5c0050..c376d06 100644
--- a/modules/snmp.py
+++ b/modules/snmp.py
@@ -445,7 +445,7 @@ def snmpwalk_on_suboid(hostname, ip, oid, hex_plain = False):
or value.startswith('No Such Object available') or
value.startswith('No Such Instance currently exists'):
continue
- if len(value) > 0 and value[0] == '"' and value[-1] !=
'"': # to be continued
+ if value == '"' or (len(value) > 1 and value[0] ==
'"' and (value[-1] != '"')): # to be continued
while True: # scan for end of this dataset
nextline = line_iter.next().strip()
value += " " + nextline