Module: check_mk
Branch: master
Commit: f11a16faebc078dd29e0ee4e6b6854353fa79812
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f11a16faebc078…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Oct 29 14:03:57 2012 +0100
WATO: sites not used in distr. WATO being skipped when
determining the prefered peer
---
ChangeLog | 2 ++
web/htdocs/wato.py | 10 +++++++++-
2 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index e7831a6..2d7a325 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -110,6 +110,8 @@
list of explicit host/services in rules)
* FIX: fix inheritation of contactgroups from folder to hosts
* FIX: fix sorting of users, fix lost user alias in some situations
+ * FIX: Sites not using distritubed WATO now being skipped when determining
+ the prefered peer
BI:
* FIX: Correct representation of (!), (!!) and (?) markers in check output
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index ee4f436..b1b9dba 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -7343,7 +7343,15 @@ def preferred_peer():
if site.get("replication") == "slave":
continue # Ignore slave sites
- if best_peer == None or site.get("repl_priority",0) >
best_peer.get("repl_priority",0) or (site_id < best_peer["id"] and
site.get("repl_priority",0) == best_peer.get("repl_priority",0)):
+ if not site.get("replication") and not site_is_local(site_id):
+ continue # Ignore sites without distributed WATO
+
+ # a) No peer found yet
+ # b) Replication priority of current site is greater than best peer
+ # c) On same priority -> use higher alphabetical order
+ if best_peer == None \
+ or site.get("repl_priority",0) >
best_peer.get("repl_priority",0) \
+ or (site_id < best_peer["id"] and
site.get("repl_priority",0) == best_peer.get("repl_priority",0)):
best_peer = site
if site_is_local(site_id):
best_working_peer = site