Module: check_mk
Branch: master
Commit: c405b74dcdabe292f8909b76b7fdd4257254fe05
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c405b74dcdabe2…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Oct 14 00:52:31 2013 +0200
FIX: avoid exception when only one node of a cluster has services
---
ChangeLog | 1 +
modules/check_mk_base.py | 11 ++++++-----
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 595cf04..77b52ed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
1.2.3i5:
Core:
* FIX: inventory check now honors settings for exit code
+ * FIX: avoid exception when only one node of a cluster has services
Multisite:
* Speed-O-Meter: now measure only service checks. Host checks
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index d0da123..55a7046 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -278,14 +278,15 @@ def get_host_info(hostname, ipaddress, checkname):
is_snmp_error = False
for node in nodes:
# If an error with the agent occurs, we still can (and must)
- # try the other node.
+ # try the other nodes.
try:
ipaddress = lookup_ipaddress(node)
new_info = get_realhost_info(node, ipaddress, checkname,
cluster_max_cachefile_age)
- if add_nodeinfo:
- new_info = [ [node] + line for line in new_info ]
- info += new_info
- at_least_one_without_exception = True
+ if new_info != None:
+ if add_nodeinfo:
+ new_info = [ [node] + line for line in new_info ]
+ info += new_info
+ at_least_one_without_exception = True
except MKSkipCheck:
at_least_one_without_exception = True
except MKAgentError, e: