Module: check_mk
Branch: master
Commit: 8f4d40ffed7c5961f2e40c6f6cc152a1a223503e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8f4d40ffed7c59…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Feb 21 15:57:57 2011 +0100
read in local.mk as last file, sort conf.d files
---
.bugs/33 | 10 +++++++---
ChangeLog | 3 +++
modules/check_mk.py | 13 ++++++++++---
3 files changed, 20 insertions(+), 6 deletions(-)
diff --git a/.bugs/33 b/.bugs/33
index cceb386..f39be6c 100644
--- a/.bugs/33
+++ b/.bugs/33
@@ -1,10 +1,14 @@
Title: Datei local.mk, die nicht gebackupt wird
Component: core
+State: done
+Class: feature
+Date: 2010-12-21 20:50:02
Benefit: 1
-State: open
Cost: 1
-Date: 2010-12-21 20:50:02
-Class: feature
+Fun: 0
Analog zu final, kommt noch nach final und wird von backup/restore
nicht angefasst.
+
+2011-02-21 15:57:37: changed state open -> done
+Is done. View updated docu for details.
diff --git a/ChangeLog b/ChangeLog
index fbf282d..672143f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,9 @@
* FIX: read *.include files before checks. Fixes df_netapp not finding
its check function
* FIX: inventory checks on SNMP+TCP hosts ignored new TCP checks
+ * local.mk: This file is read after final.mk and *not* backup up
+ or restored
+ * read all files in conf.d/*.mk in alphabetical order now.
Checks & Agents:
* ucd_cpu_load: new check for CPU load via UCD SNMP agent
diff --git a/modules/check_mk.py b/modules/check_mk.py
index a98a40d..c3acd35 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -3756,13 +3756,20 @@ def do_automation(cmd, args):
def all_nonfunction_vars():
return set([ name for name,value in globals().items() if name[0] != '_' and
type(value) != type(lambda:0) ])
-vars_before_config = all_nonfunction_vars()
-list_of_files = [ check_mk_configfile ] + glob.glob(check_mk_configdir +
'/*.mk')
+# Create list of all files to be included
+list_of_files = glob.glob(check_mk_configdir + '/*.mk')
+list_of_files.sort()
+list_of_files = [ check_mk_configfile ] + list_of_files
final_mk = check_mk_basedir + "/final.mk"
if os.path.exists(final_mk):
list_of_files.append(final_mk)
+local_mk = check_mk_basedir + "/local.mk"
+if os.path.exists(local_mk):
+ list_of_files.append(local_mk)
+
+vars_before_config = all_nonfunction_vars()
for _f in list_of_files:
# Hack: during parent scan mode we must not read in old version of parents.mk!
if '--scan-parents' in sys.argv and _f.endswith("/parents.mk"):
@@ -3840,7 +3847,7 @@ if __name__ == "__main__":
checks = autochecks + checks
vars_after_config = all_nonfunction_vars()
-ignored_variables = set(['vars_before_config', 'rrdtool',
'final_mk', 'list_of_files', 'autochecks',
+ignored_variables = set(['vars_before_config', 'rrdtool',
'autochecks',
'parts' ,'hosttags' ,'seen_hostnames'
,'all_hosts_untagged' ,'taggedhost' ,'hostname'])
errors = 0
for name in vars_after_config: