Module: check_mk
Branch: master
Commit: f6817297dbeee3361c10abfa2d03d7cbe65f7188
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f6817297dbeee3…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Jan 26 08:11:04 2012 +0100
New config variable snmpv2c_hosts
---
ChangeLog | 3 +++
modules/check_mk.py | 10 +++++++++-
web/plugins/wato/check_mk_configuration.py | 16 ++++++++++++----
3 files changed, 24 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f1ccae0..66a31ab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,9 @@
display string in the multisite GUI
* FIX: Fixed encoding problems with umlauts in group aliases
* FIX: honor extra_summary_host_conf (was ignored)
+ * new config variable snmpv2c_hosts that allows to enable SNMP v2c
+ but *not* bulkwalk (for some broken devices). bulkwalk_hosts still
+ implies v2c.
Checks & Agents:
* Windows agent: output eventlog texts in UTF-8 encoding. This
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 3df7ff9..5708d28 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -263,6 +263,7 @@ host_paths = {}
snmp_hosts = [ (['snmp'], ALL_HOSTS) ]
tcp_hosts = [ (['tcp'], ALL_HOSTS), (NEGATE,
['snmp'], ALL_HOSTS), (['!ping'], ALL_HOSTS) ]
bulkwalk_hosts = []
+snmpv2c_hosts = []
usewalk_hosts = []
dyndns_hosts = [] # use host name as ip address for these hosts
ignored_checktypes = [] # exclude from inventory
@@ -593,9 +594,12 @@ def snmp_base_command(what, hostname):
if is_bulkwalk_host(hostname):
options = '-v2c'
else:
- options = '-v1'
if what == 'walk':
command = 'snmpwalk'
+ if is_snmpv2c_host(hostname):
+ options = '-v2c'
+ else:
+ options = '-v1'
options += " -c '%s'" % credentials
# Handle V3
@@ -648,6 +652,10 @@ def is_bulkwalk_host(hostname):
else:
return False
+def is_snmpv2c_host(hostname):
+ return is_bulkwalk_host(hostname) or \
+ in_binary_hostlist(hostname, snmpv2c_hosts)
+
def is_usewalk_host(hostname):
return in_binary_hostlist(hostname, usewalk_hosts)
diff --git a/web/plugins/wato/check_mk_configuration.py
b/web/plugins/wato/check_mk_configuration.py
index 858d5cb..9430add 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -752,14 +752,22 @@ register_rule(group,
register_rule(group,
"bulkwalk_hosts",
- title = _("Hosts using SNMP v2c (and bulk walk)"),
+ title = _("Hosts using bulk walk (and SNMP v2c)"),
help = _("Most SNMP hosts support SNMP version 2c. However, Check_MK defaults to
version 1, "
"in order to support as many devices as possible. Please use this
ruleset in order "
"to configure SNMP v2c for as many hosts as possible. That version has
two advantages: "
- "it supports 64 bit counters, which avoid problems with wrapping
counters at too "
- "much traffic. And it support bulk walk, which saves much CPU and
network ressourecs. "
+ "it supports 64 bit counters, which avoids problems with wrapping
counters at too "
+ "much traffic. And it support bulk walk, which saves much CPU and
network ressources. "
"Please be aware, however, that there are some broken devices out
there, that support "
- "v2c but behave very bad when it is used. "))
+ "bulk walk but behave very bad when it is used. When you want to enable
v2c while not using "
+ "bulk walk, please use the rule set snmpv2c_hosts instead."))
+
+register_rule(group,
+ "snmpv2c_hosts",
+ title = _("Hosts using SNMP v2c (and no bulk walk)"),
+ help = _("There exist a few devices out there that behave very badly when using
SNMP bulk walk. "
+ "If you want to use SNMP v2c on those devices, nevertheless, then use
this rule set. "
+ "One reason is enabling 64 bit counters."))
group = _("Operation mode of Check_MK")