Module: check_mk
Branch: master
Commit: e1d5b5f3799d1cf44fa64d2e60e921df8e6b9dce
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e1d5b5f3799d1c…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Oct 29 10:32:49 2014 +0100
Behaviour in the previous version: If a host should be inventorized it was checked
with the full palette of all available snmp inventory functions. The filtering of unwanted
checktypes
was done afterwards. This caused needless snmp queries towards the snmp host.
The filtering of unwanted checktypes is now done before the snmp host is contacted.
Note: This only applies to the WATO rule <i>Disabled checktypes</i>
respectively the parameters
<tt>ignored_checktypes</tt> and <tt>ignored_checks</tt>, but not
to <i>Disabled services</i>.
The latter one matches to service descriptions which are the result of a successful
inventory.
---
.werks/1429 | 17 +++++++++++++++++
ChangeLog | 1 +
modules/check_mk.py | 13 ++++++++-----
3 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/.werks/1429 b/.werks/1429
new file mode 100644
index 0000000..d9470d5
--- /dev/null
+++ b/.werks/1429
@@ -0,0 +1,17 @@
+Title: Disabled snmp checktypes are now sorted out before Check_MK contacts the snmp
host
+Level: 2
+Component: core
+Compatible: compat
+Version: 1.2.5i6
+Date: 1414574411
+Class: fix
+
+Behaviour in the previous version: If a snmp host should be inventorized it was checked
+with the full palette of all available snmp inventory functions. The filtering of
unwanted checktypes
+was done afterwards. This caused needless snmp queries towards the snmp host.
+
+The filtering of unwanted checktypes is now done before the snmp host is contacted.
+Note: This only applies to the WATO rule <i>Disabled checktypes</i>
respectively the parameters
+<tt>ignored_checktypes</tt> and <tt>ignored_checks</tt>, but not
to <i>Disabled services</i>.
+The latter one matches to service descriptions which are the result of a successful
inventory.
+
diff --git a/ChangeLog b/ChangeLog
index 43ccf0f..2c9d4f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
* 1425 New section header option "encoding" for agent output...
* 1129 FIX: Windows MSI-Installer: some systems created corrupted check_mk_agent.msi
files...
* 1426 FIX: windows agent: logwatch: no longer reports incorrect formatted texts
(japanese characters)...
+ * 1429 FIX: Disabled snmp checktypes are now sorted out before Check_MK contacts the
snmp host...
Checks & Agents:
* 0185 knuerr_rms_humidity, knuerr_rms_temp: Two new Checks to Monitor the
Temperature and the Humidity on Knürr RMS Devices
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 1781abc..f6ba3c6 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -2857,10 +2857,13 @@ def make_inventory(checkname, hostnamelist, check_only=False,
include_state=Fals
try:
for host in hostnamelist:
-
- # Skip SNMP checks on non-SNMP hosts
- if is_snmp_check and not is_snmp_host(host):
- continue
+ if is_snmp_check:
+ # Skip SNMP check on non-SNMP hosts
+ if not is_snmp_host(host):
+ continue
+ # Skip SNMP check if this checktype is disabled
+ if service_ignored(host, checkname, None):
+ continue
# The decision wether to contact the agent via TCP
# is done in get_realhost_info(). This is due to
@@ -3109,7 +3112,7 @@ def check_inventory(hostname):
def service_ignored(hostname, checktype, service_description):
if checktype and checktype in ignored_checktypes:
return True
- if in_boolean_serviceconf_list(hostname, service_description, ignored_services):
+ if service_description != None and in_boolean_serviceconf_list(hostname,
service_description, ignored_services):
return True
if checktype and checktype_ignored_for_host(hostname, checktype):
return True