Module: check_mk
Branch: master
Commit: d884fe0b5c2c1f78c1e3b52c732db2980c78b9fc
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d884fe0b5c2c1f…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Jan 17 15:27:48 2013 +0100
Fix: Distritubed monitoring setup:
- site configuration changes no longer mark all sites as dirty
- correct logfile cleanup on 'Activate changes'
---
ChangeLog | 2 ++
web/htdocs/wato.py | 18 ++++++++++++++----
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 7d8a0c5..f1b8e73 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -20,6 +20,8 @@
* Storing row selections in user files, cleaned up row selection
handling to single files. Cleaned up GET/POST mixups in confirm dialogs
* Add: New user_options to limit seen nagios objects even the role is set to see all
+ * Fix: On site configaration changes, only relevant sites are marked as dirty
+ * Fix: Distributed setup: Correct cleanup of pending changes logfile after
"Activate changes"
1.2.1i4:
Core:
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index cabef4c..ba6f916 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -6653,16 +6653,22 @@ def mode_edit_site(phase):
if not new and "secret" in old_site:
new_site["secret"] = old_site["secret"]
+
save_sites(sites)
+
+ # Own site needs SYNCRESTART in any case
+ update_replication_status(our_site_id(), { "need_restart" : True })
+
if new:
- log_pending(SYNCRESTART, None, "edit-sites", _("Created new
connection to site %s" % id))
+ update_replication_status(id, { "need_sync" : True,
"need_restart" : True })
+ log_pending(AFFECTED, None, "edit-sites", _("Created new
connection to site %s" % id))
else:
- log_pending(SYNCRESTART, None, "edit-sites", _("Modified site
connection %s" % id))
+ log_pending(AFFECTED, None, "edit-sites", _("Modified site
connection %s" % id))
# Replication mode has switched on/off => handle replication state
repstatus = load_replication_status()
- if repl and id not in repstatus: # Repl switched on
+ if repl: # Repl is on
update_replication_status(id, { "need_sync" : True,
"need_restart" : True })
- elif (not repl) and id in repstatus:
+ elif id in repstatus: # Repl switched off
update_replication_status(id, None) # Replication switched off
if is_distributed() and global_replication_state() == "clean":
log_commit_pending()
@@ -7281,6 +7287,10 @@ def ajax_replication():
result = str(e)
if result == True:
answer = "OK:" + _("Success");
+ # Make sure that the pending changes are clean as soon as the
+ # last site has successfully been updated.
+ if is_distributed() and global_replication_state() == "clean":
+ log_commit_pending()
else:
answer = "<div class=error>%s: %s</div>" %
(_("Error"), hilite_errors(result))