Module: check_mk
Branch: master
Commit: b54b7e3aeac1fc11bc4c13d805d282995cf8d554
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b54b7e3aeac1fc…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jul 27 13:06:55 2016 +0200
Write out passwords for monitoring core during core config creation
---
modules/check_mk.py | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 994f097..aaa4b69 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -48,6 +48,7 @@ import inspect
from cmk.regex import regex, is_regex
from cmk.exceptions import MKGeneralException, MKTerminate
import cmk.tty as tty
+import cmk.store as store
# These variable will be substituted at 'make dist' time
check_mk_version = '(inofficial)'
@@ -3382,6 +3383,8 @@ def create_core_config():
out = file(nagios_objects_file, "w")
create_nagios_config(out)
+ write_stored_passwords()
+
num_warnings = len(g_configuration_warnings)
if num_warnings > 10:
g_configuration_warnings = g_configuration_warnings[:10] + \
@@ -3435,6 +3438,14 @@ def verify_cluster_address_family(hostname):
(hostname, ",
".join(address_families)))
+def write_stored_passwords():
+ formated = ""
+ for ident, pw in stored_passwords.items():
+ formated += "%s:%s\n" % (ident, pw["password"])
+
+ store.save_mk_file(var_dir + "/stored_passwords.mk", formated)
+
+
def get_cluster_nodes_for_config(hostname):
verify_cluster_address_family(hostname)