Module: check_mk
Branch: master
Commit: 7d32fbeee7236897a374bace2e4e6b9eaede39ac
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7d32fbeee72368…
Author: Sven Rueß <sr(a)mathias-kettner.de>
Date: Wed Aug 3 13:35:52 2016 +0200
new bugs
---
.bugs/2505 | 9 +++++++++
.bugs/2506 | 12 ++++++++++++
2 files changed, 21 insertions(+)
diff --git a/.bugs/2505 b/.bugs/2505
new file mode 100644
index 0000000..179c72c
--- /dev/null
+++ b/.bugs/2505
@@ -0,0 +1,9 @@
+Title: Wrong calculation of levels for remaining space in per cent on small filesystems
+Component: checks
+State: open
+Date: 2016-08-03 13:14:29
+Targetversion: 1.2.8
+Class: bug
+
+On small filesystems like 4KB on routers or switches the calculation of remaining hard disk space at per cent is wrong.
+The calculation calculates the wrong levels for it.
diff --git a/.bugs/2506 b/.bugs/2506
new file mode 100644
index 0000000..d9b93e3
--- /dev/null
+++ b/.bugs/2506
@@ -0,0 +1,12 @@
+Title: Rule Disabled Services only work with positive result
+Component: wato
+State: open
+Date: 2016-08-03 13:19:26
+Targetversion: 1.2.8
+Class: bug
+
+You want to disable all Services like MSSQL.* and use one rule with a positive outcome.
+All services will be disabled.
+After that rule you add another one and try to get explizit services again like MSSQL Production$.
+That shoudl work with a negative outcome. It will not work. All combinations do not get the result,
+that was wished. Disable all services and include only some of them.
Module: check_mk
Branch: master
Commit: 4dfa63dbaa17b2701f4cf59867313717457b3e62
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4dfa63dbaa17b2…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Aug 3 11:13:33 2016 +0200
Updated bug entries #2464, #2463
---
.bugs/2463 | 11 +++++++++++
.bugs/2464 | 10 ++++++++++
2 files changed, 21 insertions(+)
diff --git a/.bugs/2463 b/.bugs/2463
new file mode 100644
index 0000000..26afb67
--- /dev/null
+++ b/.bugs/2463
@@ -0,0 +1,11 @@
+Title: Hosts without site attribute are monitored by all sites
+Component: core
+State: open
+Date: 2016-08-03 11:10:47
+Targetversion: 1.2.8
+Class: bug
+
+When creating a host manually or with "hole" script, these hosts have no site attribute set. When this is synced
+to a slave site, the host is monitored by both sites.
+
+We should detect that and only monitor those hosts on standalone sites or WATO master sites.
diff --git a/.bugs/2464 b/.bugs/2464
new file mode 100644
index 0000000..4d89954
--- /dev/null
+++ b/.bugs/2464
@@ -0,0 +1,10 @@
+Title: Hosts configured for a multisite only site are monitored on master
+Component: wato
+State: open
+Date: 2016-08-03 11:12:16
+Targetversion: 1.2.8
+Class: bug
+
+When having the master site connected with another site only in the status world, without
+distributed WATO and assigning a host to that site, the host is still monitored by the
+master site. The host should simply not be monitored instead.
Module: check_mk
Branch: master
Commit: 60e94e65a1b629c968e8e187b921ca9a1c3f62a0
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=60e94e65a1b629…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Aug 3 10:49:58 2016 +0200
3752 FIX Fixed loosing site configuration when editing hosts in WATO slave sites
When having a distributed setup where WATO is enabled on slaves and hosts were
editied, the hosts in the folder of that host were resetting the site attribute
so that they are being monitored by the remote site, even when they were configured
to be monitored on another site.
The slave sites are now checking for the configured unknown sites and warning you
about that fact. To override the configured site attributes, you have to explicitly
change the value of the site attribute.
---
.werks/3752 | 16 +++++++++++++
web/htdocs/config.py | 1 +
web/htdocs/valuespec.py | 13 ++++++++--
web/htdocs/watolib.py | 61 ++++++++++++++++++++++++++++++-----------------
4 files changed, 67 insertions(+), 24 deletions(-)
diff --git a/.werks/3752 b/.werks/3752
new file mode 100644
index 0000000..015dd13
--- /dev/null
+++ b/.werks/3752
@@ -0,0 +1,16 @@
+Title: Fixed loosing site configuration when editing hosts in WATO slave sites
+Level: 2
+Component: wato
+Compatible: compat
+Version: 1.2.8p9
+Date: 1470213362
+Class: fix
+
+When having a distributed setup where WATO is enabled on slaves and hosts were
+editied, the hosts in the folder of that host were resetting the site attribute
+so that they are being monitored by the remote site, even when they were configured
+to be monitored on another site.
+
+The slave sites are now checking for the configured unknown sites and warning you
+about that fact. To override the configured site attributes, you have to explicitly
+change the value of the site attribute.
diff --git a/web/htdocs/config.py b/web/htdocs/config.py
index 0335e2c..90fb6f6 100644
--- a/web/htdocs/config.py
+++ b/web/htdocs/config.py
@@ -578,6 +578,7 @@ def default_site():
return None
+
def is_multisite():
# TODO: Remove all calls of this function
return True
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index 8181c8b..6440e81 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -1282,7 +1282,7 @@ class DropdownChoice(ValueSpec):
# In complain mode: Use the value received from the HTML variable
if self._invalid_choice == "complain" and value != None and self._value_is_invalid(value):
defval = value
- options.append((value, "%s (%s)" % (value, self._invalid_choice_title)))
+ options.append((defval, self._get_invalid_choice_title(value)))
if value == None and not options:
html.write(self._empty_text)
@@ -1298,6 +1298,14 @@ class DropdownChoice(ValueSpec):
else:
html.sorted_select(varprefix, options, defval, onchange=self._on_change)
+
+ def _get_invalid_choice_title(self, value):
+ if "%s" in self._invalid_choice_title:
+ return self._invalid_choice_title % value
+ else:
+ return self._invalid_choice_title
+
+
def value_to_text(self, value):
for entry in self.choices():
val, title = entry[:2]
@@ -1306,7 +1314,8 @@ class DropdownChoice(ValueSpec):
return title.split(self._help_separator, 1)[0].strip()
else:
return title
- return _("(other: %s)" % html.attrencode(value))
+ return html.attrencode(self._get_invalid_choice_title(value))
+
def from_html_vars(self, varprefix):
sel = html.var(varprefix)
diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py
index 80364b8..d32e7df 100644
--- a/web/htdocs/watolib.py
+++ b/web/htdocs/watolib.py
@@ -1246,7 +1246,7 @@ class Folder(BaseFolder):
elif self.has_parent():
return self.parent().site_id()
else:
- return config.default_site()
+ return default_site()
def all_site_ids(self):
@@ -3429,6 +3429,20 @@ def is_distributed(sites = None):
return False
+# Returns the ID of the default site. This is the site the main folder has
+# configured by default. It inherits to all folders and hosts which don't have
+# a site set on their own.
+# In standalone and master sites this defaults to the local site. In distributed
+# slave sites, we don't know the site ID of the master site. We set this explicit
+# to false to configure that this host is monitored by another site (that we don't
+# know about).
+def default_site():
+ if is_wato_slave_site():
+ return False
+ else:
+ return config.default_site()
+
+
def is_wato_slave_site():
return has_distributed_wato_file() and not has_wato_slave_sites()
@@ -3443,38 +3457,41 @@ def wato_slave_sites():
def declare_site_attribute():
undeclare_host_attribute("site")
- if is_distributed():
- declare_host_attribute(SiteAttribute(), show_in_table = True, show_in_folder = True)
+ declare_host_attribute(SiteAttribute(), show_in_table = True, show_in_folder = True)
-class SiteAttribute(Attribute):
+class SiteAttribute(ValueSpecAttribute):
def __init__(self):
# Default is is the local one, if one exists or
# no one if there is no local site
- self._choices = []
+ choices = []
for id, site in config.sites.items():
title = id
if site.get("alias"):
title += " - " + site["alias"]
- self._choices.append((id, title))
-
- self._choices.sort(cmp=lambda a,b: cmp(a[1], b[1]))
- self._choices_dict = dict(self._choices)
- Attribute.__init__(self, "site", _("Monitored on site"),
- _("Specify the site that should monitor this host."),
- default_value = config.default_site())
-
- def paint(self, value, hostname):
- return "", self._choices_dict.get(value, value)
-
- def render_input(self, varprefix, value):
- html.select(varprefix + "site", self._choices, value)
-
- def from_html_vars(self, varprefix):
- return html.var(varprefix + "site")
+ choices.append((id, title))
+
+ choices.sort(cmp=lambda a,b: cmp(a[1], b[1]))
+
+ ValueSpecAttribute.__init__(self, "site", DropdownChoice(
+ title=_("Monitored on site"),
+ help=_("Specify the site that should monitor this host."),
+ default_value = default_site(),
+ choices = choices,
+ invalid_choice = "complain",
+ invalid_choice_title = _("Unknown site (%s)"),
+ 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 != None:
+ if value == False:
+ return [ "site:" ]
+ elif value != None:
return [ "site:" + value ]
else:
return []