Module: check_mk
Branch: master
Commit: 4b43881447220e9fa7fe033d001217df4241e1f2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4b43881447220e…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Feb 19 16:00:07 2019 +0100
added WK6706: BI availability no longer creates N/A periods if an elements within the BI was not known at the time
Change-Id: Id5cb9661e006ffe8d8d01c30394152ffc93c61c0
---
.werks/6706 | 18 ++++++++++++++++++
cmk/gui/availability.py | 4 ++++
2 files changed, 22 insertions(+)
diff --git a/.werks/6706 b/.werks/6706
new file mode 100644
index 0000000..b9cfc91
--- /dev/null
+++ b/.werks/6706
@@ -0,0 +1,18 @@
+Title: BI availability no longer creates N/A periods if an element within the BI was not known at the time
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1550580832
+
+WK:4202 introduced some special handling for BI aggregations:
+
+<tt>
+When computing the availability of a BI aggregation for a time range during which new hosts or services were added to the monitoring the state of these objects would be displayed as PEND before point of time they were added. But this is not correct. These objects where not pending but simply not yet existing and thus not contained in the aggregation tree at all at that time.
+</tt>
+
+This introduced an side effect, so that some availability reports of an aggregation still shows N/A even when the
+user has explicitly switched off <tt>Include unmonitored time</tt>.
diff --git a/cmk/gui/availability.py b/cmk/gui/availability.py
index 2759b87..da057d1 100644
--- a/cmk/gui/availability.py
+++ b/cmk/gui/availability.py
@@ -820,6 +820,10 @@ def compute_availability(what, av_rawdata, avoptions):
s = "unmonitored"
if not avoptions["consider"]["unmonitored"]:
consider = False
+ elif state is None:
+ # state is None means that this element was not known at this given time
+ # So there is no reason for creating a fake pending state
+ consider = False
elif span["in_notification_period"] == 0 and avoptions[
"notification_period"] == "exclude":
consider = False
Module: check_mk
Branch: master
Commit: 8ad746bf41e25679de6c61a71c61859ba8dbefb6
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8ad746bf41e256…
Author: Florian Kromer <fk(a)mathias-kettner.de>
Date: Mon Feb 18 16:14:33 2019 +0100
7035 FIX lnx_thermal: Fixed crash caused to unusual outputs
Previously the check crashed in case the agent dlivered thermal zone data with
various degrees of details. This werk takes into account that these
heterogeneous formats can occur and prevents the check additionally to crash
due to invalid or currently unknown data formats.
CMK-1506
Commit ab8068a5a45
Change-Id: I68ca53f3076199892f2bdafc099c35f0f698140c
---
.werks/7035 | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/.werks/7035 b/.werks/7035
new file mode 100644
index 0000000..d167a27
--- /dev/null
+++ b/.werks/7035
@@ -0,0 +1,17 @@
+Title: lnx_thermal: Fixed crash caused to unusual outputs
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1550502831
+Class: fix
+
+Previously the check crashed in case the agent delivered thermal zone data with
+various degrees of details. This werk takes into account that these
+heterogeneous formats can occur and prevents the check additionally to crash
+due to invalid or currently unknown data formats.
+
+CMK-1506
+Commit ab8068a5a45
+
Module: check_mk
Branch: master
Commit: 339634e6f9998aed13c8693f15fcde199d8966a4
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=339634e6f9998a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Feb 18 19:42:36 2019 +0100
WATO: Cleaned up module global state
The sidebar reload state is now held by the request global
need_sidebar_reload instead of a module global variable.
Change-Id: Ie8b51ecc526b95624e4c18ec47b59afd961f6f7f
---
cmk/gui/watolib/__init__.py | 2 --
cmk/gui/watolib/sidebar_reload.py | 13 +++----------
2 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/cmk/gui/watolib/__init__.py b/cmk/gui/watolib/__init__.py
index 45273c7..16d377f 100644
--- a/cmk/gui/watolib/__init__.py
+++ b/cmk/gui/watolib/__init__.py
@@ -314,8 +314,6 @@ def load_watolib_plugins():
# robust way for doing something like this. If it is locked before, it can now happen
# that this call unlocks the wider locking when calling this funktion in a wrong way.
def init_wato_datastructures(with_wato_lock=False):
- cmk.gui.watolib.sidebar_reload.reset()
-
if os.path.exists(ConfigDomainCACertificates.trusted_cas_file) and\
not _need_to_create_sample_config():
return
diff --git a/cmk/gui/watolib/sidebar_reload.py b/cmk/gui/watolib/sidebar_reload.py
index f13198a..d4f7e7b 100644
--- a/cmk/gui/watolib/sidebar_reload.py
+++ b/cmk/gui/watolib/sidebar_reload.py
@@ -24,19 +24,12 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-# TODO: Cleanup this module level state
-_need_sidebar_reload = None
-
-
-def reset():
- global _need_sidebar_reload
- _need_sidebar_reload = None
+from cmk.gui.globals import current_app
def need_sidebar_reload():
- global _need_sidebar_reload
- _need_sidebar_reload = True
+ current_app.g["need_sidebar_reload"] = True
def is_sidebar_reload_needed():
- return _need_sidebar_reload
+ return current_app.g.get("need_sidebar_reload", False)
Module: check_mk
Branch: master
Commit: b1d1c33621f60241a84f5da78811e31f895a4bfc
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b1d1c33621f602…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Feb 18 19:39:11 2019 +0100
WATO Git: Cleaned up module global state
The git commit messages are now held by the request global
wato_git_messages entry instead of a module global variable.
Change-Id: Idc095e7f5dd2c76b239c759b62a0d5c1859be5c4
---
cmk/gui/watolib/__init__.py | 7 -------
cmk/gui/watolib/git.py | 16 +++++++---------
2 files changed, 7 insertions(+), 16 deletions(-)
diff --git a/cmk/gui/watolib/__init__.py b/cmk/gui/watolib/__init__.py
index 096d96a..45273c7 100644
--- a/cmk/gui/watolib/__init__.py
+++ b/cmk/gui/watolib/__init__.py
@@ -314,9 +314,6 @@ def load_watolib_plugins():
# robust way for doing something like this. If it is locked before, it can now happen
# that this call unlocks the wider locking when calling this funktion in a wrong way.
def init_wato_datastructures(with_wato_lock=False):
- if config.wato_use_git:
- cmk.gui.watolib.git.prepare_git_commit()
-
cmk.gui.watolib.sidebar_reload.reset()
if os.path.exists(ConfigDomainCACertificates.trusted_cas_file) and\
@@ -357,10 +354,6 @@ def _create_sample_config():
if not _need_to_create_sample_config():
return
- # Just in case. If any of the following functions try to write Git messages
- if config.wato_use_git:
- cmk.gui.watolib.git.prepare_git_commit()
-
# Global configuration settings
save_global_settings({
"use_new_descriptions_for": [
diff --git a/cmk/gui/watolib/git.py b/cmk/gui/watolib/git.py
index 21c7372..cf0e4bb 100644
--- a/cmk/gui/watolib/git.py
+++ b/cmk/gui/watolib/git.py
@@ -31,21 +31,19 @@ import subprocess
import cmk.utils
import cmk.gui.config as config
+from cmk.gui.globals import current_app
from cmk.gui.i18n import _
from cmk.gui.exceptions import MKGeneralException
from cmk.gui.log import logger
-# TODO: Clean this up
-_messages = [] # type: List[str]
-
-def prepare_git_commit():
- global _messages
- _messages = []
+def add_message(message):
+ _git_messages().append(message)
-def add_message(message):
- _messages.append(message)
+def _git_messages():
+ """Initializes the request global data structure and returns it"""
+ return current_app.g.setdefault("wato_git_messages", [])
def do_git_commit():
@@ -77,7 +75,7 @@ def do_git_commit():
logger.debug("GIT: Still has pending changes")
_git_add_files()
- message = ", ".join(_messages)
+ message = ", ".join(_git_messages())
if not message:
message = _("Unknown configuration change")