[checkmk-commits] Check_MK Git: check_mk: Disabled baking of agents during restart by default; added support for manual baking

Lars Michelsen lm at mathias-kettner.de
Mon Feb 23 11:46:28 CET 2015


Module: check_mk
Branch: master
Commit: a134f14f6ea957d001ac554fc4b4e52a6270110d
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a134f14f6ea957d001ac554fc4b4e52a6270110d

Author: Lars Michelsen <lm at mathias-kettner.de>
Date:   Mon Feb 23 11:46:04 2015 +0100

Disabled baking of agents during restart by default; added support for manual baking

---

 modules/automation.py |    5 +++++
 modules/config.py     |    2 +-
 web/htdocs/wato.py    |   11 +++++++++++
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/modules/automation.py b/modules/automation.py
index 3a05ebd..95491e8 100644
--- a/modules/automation.py
+++ b/modules/automation.py
@@ -46,6 +46,8 @@ def do_automation(cmd, args):
         elif cmd == "update-dns-cache":
             read_config_files(with_autochecks=False)
             result = automation_update_dns_cache()
+        elif cmd == "bake-agents":
+            result = automation_bake_agents()
         else:
             read_config_files()
             if cmd == "try-inventory":
@@ -1124,3 +1126,6 @@ def execute_check_plugin(commandline):
 def automation_update_dns_cache():
     return do_update_dns_cache()
 
+def automation_bake_agents():
+    if "do_bake_agents" in globals():
+        return do_bake_agents()
diff --git a/modules/config.py b/modules/config.py
index cd5e20a..9718c9f 100644
--- a/modules/config.py
+++ b/modules/config.py
@@ -167,4 +167,4 @@ use_new_descriptions_for             = []
 
 # Rulesets for agent bakery
 agent_config                         = {}
-bake_agents_on_restart               = True
+bake_agents_on_restart               = False
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 4cbfe4b..19e50b2 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -5043,6 +5043,10 @@ def log_pending(status, linkinfo, what, message, user_id = None):
     log_audit(linkinfo, what, message, user_id)
     need_sidebar_reload()
 
+    # On each change to the Check_MK configuration mark the agents to be rebuild
+    if 'need_to_bake_agents' in globals():
+        need_to_bake_agents()
+
     if not is_distributed():
         if status != SYNC:
             log_entry(linkinfo, what, message, "pending.log", user_id)
@@ -16102,6 +16106,13 @@ def create_sample_config():
     # Global settings
     use_new_descriptions_for = [ "df", "ps" ]
 
+    # Initial baking of agents (when bakery is available)
+    if 'bake_agents' in globals():
+        try:
+            bake_agents()
+        except:
+            pass # silently ignore building errors here
+
 #.
 #   .--Pattern Editor------------------------------------------------------.
 #   |   ____       _   _                    _____    _ _ _                 |



More information about the checkmk-commits mailing list