Module: check_mk
Branch: master
Commit: fdc9d0180798a06d8a311201ce120c6708da69f5
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fdc9d0180798a0…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Nov 10 16:14:14 2014 +0100
Inline-SNMP can now be configured to use limited OID ranges for bulkwalks
---
modules/check_mk.py | 1 +
modules/check_mk_base.py | 4 ++--
modules/snmp.py | 4 ++--
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index a54e153..a2b433a 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -3358,6 +3358,7 @@ no_inventory_possible = None
if has_inline_snmp and use_inline_snmp:
output.write(stripped_python_file(modules_dir +
"/inline_snmp.py"))
+ output.write("\ndef oid_range_limits_of(hostname):\n return
%r\n" % oid_range_limits_of(hostname))
else:
output.write("has_inline_snmp = False\n")
else:
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index c372517..d89e2a1 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -381,12 +381,12 @@ def get_realhost_info(hostname, ipaddress, check_type,
max_cache_age, ignore_che
# a separate snmp table. The overall result is then the list
# of these results.
if type(oid_info) == list:
- table = [ get_snmp_table(hostname, ipaddress, entry) for entry in oid_info ]
+ table = [ get_snmp_table(hostname, ipaddress, check_type, entry) for entry in
oid_info ]
# if at least one query fails, we discard the hole table
if None in table:
table = None
else:
- table = get_snmp_table(hostname, ipaddress, oid_info)
+ table = get_snmp_table(hostname, ipaddress, check_type, oid_info)
store_cached_checkinfo(hostname, check_type, table)
# only write cache file in non interactive mode. Otherwise it would
# prevent the regular checking from getting status updates during
diff --git a/modules/snmp.py b/modules/snmp.py
index eb52961..c45ff46 100644
--- a/modules/snmp.py
+++ b/modules/snmp.py
@@ -84,7 +84,7 @@ def oid_to_intlist(oid):
def cmp_oids(o1, o2):
return cmp(oid_to_intlist(o1), oid_to_intlist(o2))
-def get_snmp_table(hostname, ip, oid_info):
+def get_snmp_table(hostname, ip, check_type, oid_info):
# oid_info is either ( oid, columns ) or
# ( oid, suboids, columns )
# suboids is a list if OID-infixes that are put between baseoid
@@ -137,7 +137,7 @@ def get_snmp_table(hostname, ip, oid_info):
if opt_use_snmp_walk or is_usewalk_host(hostname):
rowinfo = get_stored_snmpwalk(hostname, fetchoid)
elif has_inline_snmp and use_inline_snmp:
- rowinfo = inline_snmpwalk_on_suboid(hostname, fetchoid)
+ rowinfo = inline_snmpwalk_on_suboid(hostname, check_type, fetchoid)
else:
rowinfo = snmpwalk_on_suboid(hostname, ip, fetchoid)