Module: check_mk
Branch: master
Commit: d259e3167b69fdde546394ae1be3d9b56186060d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d259e3167b69fd…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri May 15 14:37:53 2015 +0200
Fixed problem using snmpv3 contextes in nagios based installations
---
modules/check_mk.py | 1 +
modules/snmp.py | 5 ++++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 698398b..f187bef 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -3052,6 +3052,7 @@ no_discovery_possible = None
output.write("def is_snmpv3_host(hostname):\n return % r\n\n" %
is_snmpv3_host(hostname))
output.write("def is_tcp_host(hostname):\n return % r\n\n" %
is_tcp_host(hostname))
output.write("def is_usewalk_host(hostname):\n return % r\n\n" %
is_usewalk_host(hostname))
+ output.write("def snmpv3_contexts_of_host(hostname):\n return % r\n\n" %
snmpv3_contexts_of_host(hostname))
if has_inline_snmp and use_inline_snmp:
output.write("def is_snmpv2c_host(hostname):\n return % r\n\n" %
is_snmpv2c_host(hostname))
output.write("def is_bulkwalk_host(hostname):\n return % r\n\n" %
is_bulkwalk_host(hostname))
diff --git a/modules/snmp.py b/modules/snmp.py
index 78fd211..c312e63 100644
--- a/modules/snmp.py
+++ b/modules/snmp.py
@@ -90,8 +90,11 @@ def oid_to_intlist(oid):
def cmp_oids(o1, o2):
return cmp(oid_to_intlist(o1), oid_to_intlist(o2))
+def snmpv3_contexts_of_host(hostname):
+ return host_extra_conf(hostname, snmpv3_contexts)
+
def snmpv3_contexts_of(hostname, check_type):
- for ty, rules in host_extra_conf(hostname, snmpv3_contexts):
+ for ty, rules in snmpv3_contexts_of_host(hostname):
if ty == None or ty == check_type:
return rules
return [None]