Module: check_mk
Branch: master
Commit: 077d2ad962ec45804ccc5e4bac1f54837aed7820
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=077d2ad962ec45…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Apr 28 17:06:12 2011 +0200
FIX: fix bug in snmp when using OID_END
---
modules/snmp.py | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/modules/snmp.py b/modules/snmp.py
index 6c592be..e9e0e60 100644
--- a/modules/snmp.py
+++ b/modules/snmp.py
@@ -191,6 +191,11 @@ def get_snmp_table(hostname, ip, oid_info):
max_len_col = -1
for column in targetcolumns:
+ fetchoid = oid
+ if suboid:
+ fetchoid += "." + str(suboid)
+ fetchoid += "." + str(column)
+
# column may be integer or string like "1.5.4.2.3"
colno += 1
# if column is 0, we do not fetch any data from snmp, but use
@@ -201,14 +206,10 @@ def get_snmp_table(hostname, ip, oid_info):
# string or as binary UTF-8 encoded number string
if column in [ OID_END, OID_STRING, OID_BIN ]:
index_column = colno
- columns.append([])
+ columns.append((fetchoid, []))
index_format = column
continue
- fetchoid = oid
- if suboid:
- fetchoid += "." + str(suboid)
- fetchoid += "." + str(column)
if opt_use_snmp_walk or is_usewalk_host(hostname):
rowinfo = get_stored_snmpwalk(hostname, fetchoid)