Module: check_mk
Branch: master
Commit: 8ab5416f7ccad822c42456b14af754f292b53e3a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8ab5416f7ccad8…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Nov 11 14:20:55 2015 +0100
The SNMP check interval caused the agent data of single nodes to be skipped for clusters
which could lead to CRITICAL clustered services which are based on SNMP checks.
Conflicts:
ChangeLog
modules/check_mk_base.py
---
.werks/2764 | 11 +++++++++++
ChangeLog | 1 +
modules/check_mk_base.py | 8 +++++++-
3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/.werks/2764 b/.werks/2764
new file mode 100644
index 0000000..f8f56d0
--- /dev/null
+++ b/.werks/2764
@@ -0,0 +1,11 @@
+Title: Fixed broken SNMP checks in case SNMP check interval is configured for clusters
+Level: 1
+Component: core
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i4
+Date: 1447247901
+
+The SNMP check interval caused the agent data of single nodes to be skipped for clusters
+which could lead to CRITICAL clustered services which are based on SNMP checks.
diff --git a/ChangeLog b/ChangeLog
index dea1279..7c44447 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,7 @@
* 2724 FIX: Discovery check: Fixed exception in simulation mode when no cache file
present
* 2756 FIX: SNMP: Generalized error handling of emtpy info for SNMP checks...
* 2759 FIX: Allowing Emails to contain special characters like umlauts...
+ * 2764 FIX: Fixed broken SNMP checks in case SNMP check interval is configured for
clusters...
Checks & Agents:
* 2434 NetApp monitoring: Cluster-Mode is now supported, changes in existing 7Mode
checks...
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index f13dee0..3951089 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -348,10 +348,13 @@ def get_host_info(hostname, ipaddress, checkname,
max_cachefile_age=None, ignore
# If an error with the agent occurs, we still can (and must)
# try the other nodes.
try:
+ # We must ignore the SNMP check interval when dealing with SNMP
+ # checks on cluster nodes because the cluster is always reading
+ # the cache files of the nodes.
ipaddress = lookup_ip_address(node)
new_info = get_realhost_info(node, ipaddress, checkname,
max_cachefile_age == None and cluster_max_cachefile_age or
max_cache_age,
- ignore_check_interval)
+ ignore_check_interval=True)
if new_info != None:
if add_nodeinfo:
new_info = [ [node] + line for line in new_info ]
@@ -425,6 +428,9 @@ def get_realhost_info(hostname, ipaddress, check_type, max_cache_age,
if oid_info:
cache_path = tcp_cache_dir + "/" + cache_relpath
+
+ # Handle SNMP check interval. The idea: An SNMP check should only be
+ # executed every X seconds. Skip when called too often.
check_interval = check_interval_of(hostname, check_type)
if not ignore_check_interval \
and not opt_dont_submit \