Module: check_mk
Branch: master
Commit: 752484ef82ee7dfa5952ede93690d1a8f2a4f4be
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=752484ef82ee7d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Jun 30 09:24:58 2011 +0200
FIX: Fixed .* in SNMP scan function when using stored SNMP walks
---
modules/snmp.py | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/modules/snmp.py b/modules/snmp.py
index e0fe30d..3fa670f 100644
--- a/modules/snmp.py
+++ b/modules/snmp.py
@@ -229,9 +229,9 @@ def get_snmp_table(hostname, ip, oid_info):
index_rows = []
# Take end-oids of non-index columns as indices
fetchoid, max_column = columns[max_len_col]
- for o, value in max_column:
+ for o, value in max_column:
if index_format == OID_END:
- eo = extract_end_oid(columns[max_len_col][0], o)
+ eo = extract_end_oid(fetchoid, o)
index_rows.append((o, eo))
elif index_format == OID_STRING:
index_rows.append((o, o))
@@ -436,12 +436,16 @@ def get_stored_snmpwalk(hostname, oid):
break
return rows
-
+
rowinfo = collect_until(current, -1)
rowinfo.reverse()
rowinfo += collect_until(current + 1, 1)
# import pprint ; pprint.pprint(rowinfo)
- return rowinfo
+
+ if dot_star:
+ return [ rowinfo[0] ]
+ else:
+ return rowinfo