Module: check_mk
Branch: master
Commit: 9840787ef6f6a7dffaede79e6cd244c89250a9a7
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9840787ef6f6a7…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Oct 12 09:35:15 2017 +0200
5393 MySQL agent plugin: With agent bakery it's now possible to use a local mysql config file
By default the mk_mysql agent plugin is using the /etc/check_mk/mysql.cfg configuration file
to load the configuration set in the agent bakery. This file is under control of the bakery
and may not be modified by the user locally.
It is now possible to include an optional file that the user is allowed to store and modify
locally. This may be useful in case on wants to put the agent under bakery control, but
don't want to store the database credentials in the bakery. Instead of that the credentials
can be put into this file manually.
The new file is loaded from the same directory as the mysql.cfg and it must be named
mysql.local.cfg. When using the default paths, the full path is:
<tt>/etc/check_mk/mysql.local.cfg</tt>.
Change-Id: I68203bc6859f2085cb9a2edbb8e0417ebdedc886
---
.werks/5393 | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/.werks/5393 b/.werks/5393
new file mode 100644
index 0000000..562e529
--- /dev/null
+++ b/.werks/5393
@@ -0,0 +1,22 @@
+Title: MySQL agent plugin: With agent bakery it's now possible to use a local mysql config file
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cee
+Version: 1.5.0i1
+Date: 1507793522
+Class: feature
+
+By default the mk_mysql agent plugin is using the /etc/check_mk/mysql.cfg configuration file
+to load the configuration set in the agent bakery. This file is under control of the bakery
+and may not be modified by the user locally.
+
+It is now possible to include an optional file that the user is allowed to store and modify
+locally. This may be useful in case on wants to put the agent under bakery control, but
+don't want to store the database credentials in the bakery. Instead of that the credentials
+can be put into this file manually.
+
+The new file is loaded from the same directory as the mysql.cfg and it must be named
+mysql.local.cfg. When using the default paths, the full path is:
+<tt>/etc/check_mk/mysql.local.cfg</tt>.
+
Module: check_mk
Branch: master
Commit: 4394562413c431735327a7d0ea86898c071be8b2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4394562413c431…
Author: Jukka Aro <ja(a)mathias-kettner.de>
Date: Fri Oct 6 16:52:08 2017 +0200
Use GNU autotools for building Windows agent
The Makefile for the Windows agent has been a source of many problems,
e.g. in its manual defition of build dependencies that
has been prone to errors and preventing e..g efficient build
parallelization. With GNU autoconf and automake the shortcomings of a
manually maintained Makefile can be overcome, immediately cutting build
times (-50% for a full build, even more for incremental builds due to
proper handling of dependencies) and hopefully making the build process
easier to maintain.
The 32 and 64 bit builds for Windows are now configured with different
parameters passed to the auto-generated configure script. The builds
are then run in parallel, with the possibility of specifying N parallel
jobs with the option '-jN' to the build scripts.
The README and CONTENTS files are brought up to date.
Change-Id: I8495d0ac3a47bd45d4193a4e0763fc202dd84bfe
---
agents/Makefile | 5 +-
agents/windows/.gitignore | 6 +-
agents/windows/CONTENTS | 1 +
agents/windows/Makefile | 178 ------------------------------------------
agents/windows/Makefile.am | 90 +++++++++++++++++++++
agents/windows/README | 33 ++++----
agents/windows/build-agent | 97 +++++++++++++++++++++++
agents/windows/build_version | 2 +-
agents/windows/chroot_version | 2 +-
agents/windows/configure.ac | 44 +++++++++++
agents/windows/make-agent | 101 ++++++++++--------------
agents/windows/make-chroot | 3 +
12 files changed, 301 insertions(+), 261 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=4394562413…
Module: check_mk
Branch: master
Commit: 729547367c217a40f7cf98b5f318760312e4a96d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=729547367c217a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Oct 11 16:03:49 2017 +0200
5392 FIX Fixed host monitored from all sites after editing custom host attributes
In distributed environments it could happen that all configured hosts are monitored
from all configured sites.
The now fixed issue was triggered by saving (adding/editing/removing) custom host attributes
using the "WATO > Hosts > Custom host attributes" dialog.
Background: This editing step was undeclaring the internal "site" attribute by accident
and rewriting all hosts.mk files. These files were missing the "site:..." host tag in the
all_hosts data structure. This makes all sites think that they are responsible for these
hosts.
The configured site information of the hosts/folders was not lost because it was retained
in the host_attributes data strucuture. So the hosts.mk files could be "repaired" by
saving the hosts, parent folders or host tags.
Change-Id: Ifa5c8d1d8f38bd5b644f3cde4fe526315b1d921f
---
.werks/5392 | 24 ++++++++++++++++++++++++
web/htdocs/watolib.py | 34 ----------------------------------
web/plugins/wato/builtin_attributes.py | 28 ++++++++++++++++++++++++++++
3 files changed, 52 insertions(+), 34 deletions(-)
diff --git a/.werks/5392 b/.werks/5392
new file mode 100644
index 0000000..18753c2
--- /dev/null
+++ b/.werks/5392
@@ -0,0 +1,24 @@
+Title: Fixed host monitored from all sites after editing custom host attributes
+Level: 2
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1507729401
+
+In distributed environments it could happen that all configured hosts are monitored
+from all configured sites.
+
+The now fixed issue was triggered by saving (adding/editing/removing) custom host attributes
+using the "WATO > Hosts > Custom host attributes" dialog.
+
+Background: This editing step was undeclaring the internal "site" attribute by accident
+and rewriting all hosts.mk files. These files were missing the "site:..." host tag in the
+all_hosts data structure. This makes all sites think that they are responsible for these
+hosts.
+
+The configured site information of the hosts/folders was not lost because it was retained
+in the host_attributes data strucuture. So the hosts.mk files could be "repaired" by
+saving the hosts, parent folders or host tags.
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index 3c32511..4ca72d9 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -137,7 +137,6 @@ def init_watolib_datastructures():
prepare_git_commit()
declare_host_tag_attributes() # create attributes out of tag definitions
- declare_site_attribute() # create attribute for distributed WATO
#.
# .--Constants-----------------------------------------------------------.
@@ -3845,7 +3844,6 @@ class CRESiteManagement(object):
if activate:
config.load_config() # make new site configuration active
update_distributed_wato_file(sites)
- declare_site_attribute()
Folder.invalidate_caches()
need_sidebar_reload()
@@ -3921,8 +3919,6 @@ def our_site_id():
return None
-
-
def create_nagvis_backends(sites):
cfg = [
'; MANAGED BY CHECK_MK WATO - Last Update: %s' % time.strftime('%Y-%m-%d %H:%M:%S'),
@@ -4167,36 +4163,6 @@ def get_event_console_sync_sites():
site_choices = config.site_choices
-def declare_site_attribute():
- undeclare_host_attribute("site")
- declare_host_attribute(SiteAttribute(), show_in_table = True, show_in_folder = True)
-
-
-class SiteAttribute(ValueSpecAttribute):
- def __init__(self):
- # Default is is the local one, if one exists or
- # no one if there is no local site
- ValueSpecAttribute.__init__(self, "site", SiteChoice(
- title=_("Monitored on site"),
- help=_("Specify the site that should monitor this host."),
- default_value = default_site(),
- invalid_choice_error = _("The configured site is not known to this site. In case you "
- "are configuring in a distributed slave, this may be a host "
- "monitored by another site. If you want to modify this "
- "host, you will have to change the site attribute to the "
- "local site. But this may make the host be monitored from "
- "multiple sites.")
- ))
-
- def get_tag_list(self, value):
- if value == False:
- return [ "site:" ]
- elif value != None:
- return [ "site:" + value ]
- else:
- return []
-
-
def load_site_replication_status(site_id, lock=False):
return store.load_data_from_file(site_replication_status_path(site_id), {}, lock)
diff --git a/web/plugins/wato/builtin_attributes.py b/web/plugins/wato/builtin_attributes.py
index 3354f97..2b371da 100644
--- a/web/plugins/wato/builtin_attributes.py
+++ b/web/plugins/wato/builtin_attributes.py
@@ -482,3 +482,31 @@ declare_host_attribute(ValueSpecAttribute("management_snmp_community",
show_in_folder = False,
topic = _("Management Board")
)
+
+
+class SiteAttribute(ValueSpecAttribute):
+ def __init__(self):
+ # Default is is the local one, if one exists or
+ # no one if there is no local site
+ ValueSpecAttribute.__init__(self, "site", SiteChoice(
+ title=_("Monitored on site"),
+ help=_("Specify the site that should monitor this host."),
+ default_value = default_site,
+ invalid_choice_error = _("The configured site is not known to this site. In case you "
+ "are configuring in a distributed slave, this may be a host "
+ "monitored by another site. If you want to modify this "
+ "host, you will have to change the site attribute to the "
+ "local site. But this may make the host be monitored from "
+ "multiple sites.")
+ ))
+
+ def get_tag_list(self, value):
+ if value == False:
+ return [ "site:" ]
+ elif value != None:
+ return [ "site:" + value ]
+ else:
+ return []
+
+
+declare_host_attribute(SiteAttribute(), show_in_table = True, show_in_folder = True)
Module: check_mk
Branch: master
Commit: 6f1e06d16051dfecd5fd4ce54a933e7e2408bc25
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6f1e06d16051df…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Oct 10 16:47:12 2017 +0200
5318 FIX BI aggregations can be configured to be in multiple groups
Previously if more than one group were stated in the
configuration of any aggregation, the related view displayed
an error {{Duplicate BI aggregation}}. Fixed that.
Change-Id: Ibc5fe5d35443e97018125f8dfe350192a057ed62
---
.werks/5318 | 13 +++++++++++++
web/htdocs/bi.py | 19 ++++++++++++++++++-
2 files changed, 31 insertions(+), 1 deletion(-)
diff --git a/.werks/5318 b/.werks/5318
new file mode 100644
index 0000000..60ea99e
--- /dev/null
+++ b/.werks/5318
@@ -0,0 +1,13 @@
+Title: BI aggregations can be configured to be in multiple groups
+Level: 1
+Component: bi
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1507646464
+
+Previously if more than one group were stated in the
+configuration of any aggregation, the related view displayed
+an error {{Duplicate BI aggregation}}. Fixed that.
diff --git a/web/htdocs/bi.py b/web/htdocs/bi.py
index 9fd4177..c722d5f 100644
--- a/web/htdocs/bi.py
+++ b/web/htdocs/bi.py
@@ -979,7 +979,7 @@ class BIJobManager(object):
time.sleep(0.05)
try:
- check_title_uniqueness(g_bi_cache_manager.get_compiled_trees()["forest"])
+ check_aggregation_title_uniqueness(g_bi_cache_manager.get_compiled_trees()["aggr_ref"])
except MKConfigError, e:
error_info += str(e)
@@ -1670,6 +1670,8 @@ def compile_forest(user, only_hosts = None, only_groups = None):
def check_title_uniqueness(forest):
+ # Legacy, will be removed any decade from now
+ # One aggregation cannot be in mutliple groups.
known_titles = set()
for group, aggrs in forest.iteritems():
for aggr in aggrs:
@@ -1683,6 +1685,21 @@ def check_title_uniqueness(forest):
else:
known_titles.add(title)
+
+def check_aggregation_title_uniqueness(aggregations):
+ known_titles = set()
+ for attrs in aggregations.values():
+ title = attrs["title"]
+ if title in known_titles:
+ raise MKConfigError(_("Duplicate BI aggregation with the title \"<b>%s</b>\". "
+ "Please check your BI configuration and make sure that within each group no aggregation has "
+ "the same title as any other. Note: you can use arguments in the top level "
+ "aggregation rule, like <tt>Host $HOST$</tt>.") % \
+ (html.attrencode(title)))
+ else:
+ known_titles.add(title)
+
+
# Execute an aggregation rule, but prepare arguments
# and iterate FOREACH first
def compile_rule_node(aggr_type, calllist, lvl):