Module: check_mk
Branch: master
Commit: 50cd682183038040ac07204639168435d81c068e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=50cd6821830380…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Mar 4 14:38:53 2011 +0100
snmp scan: drop quotes from strings
---
.bugs/178 | 10 +++++++---
modules/check_mk.py | 3 +++
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/.bugs/178 b/.bugs/178
index 09358cc..b4fb54f 100644
--- a/.bugs/178
+++ b/.bugs/178
@@ -1,12 +1,16 @@
Title: get_single_oid should drop quotes on strings
Component: core
+State: done
+Class: bug
+Date: 2011-03-04 14:30:38
Benefit: 1
-State: open
Cost: 1
-Date: 2011-03-04 14:30:38
-Class: bug
+Fun: 0
The snmp scan function uses get_single_oid(). That function
does not strip the quotes from strings. This is a bug.
Some scan functions depend on the quotes, so fix them as
well.
+
+2011-03-04 14:38:49: changed state open -> done
+Done. Strings are stripped if existing.
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 31aef25..6039187 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -632,6 +632,9 @@ def get_single_oid(hostname, ipaddress, oid):
or value.startswith('No Such Object available') or
value.startswith('No Such Instance currently exists'):
value = None
+ # Strip quotes
+ if value.startswith('"') and value.endswith('"'):
+ value = value[1:-1]
# try to remove text, only keep number
# value_num = value_text.split(" ")[0]
# value_num = value_num.lstrip("+")