Module: check_mk
Branch: master
Commit: b877d818fea0f71acfb79b0582c8421b35e8028b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b877d818fea0f7…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Sep 14 14:46:37 2018 +0200
6616 Add --no-tmpfs option to "omd create"
It's now possible to disable the temporary filesystem usage during
site creation.
Change-Id: I9588598560c9772ae7b88f55f5a45b1dfd131d4a
---
.werks/6616 | 11 +++++++++++
omd/packages/omd/omd | 5 +++++
omd/packages/omd/omd.8 | 5 +++++
3 files changed, 21 insertions(+)
diff --git a/.werks/6616 b/.werks/6616
new file mode 100644
index 0000000..9143f84
--- /dev/null
+++ b/.werks/6616
@@ -0,0 +1,11 @@
+Title: Add --no-tmpfs option to "omd create"
+Level: 1
+Component: omd
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1536929140
+Class: feature
+
+It's now possible to disable the temporary filesystem usage during
+site creation.
diff --git a/omd/packages/omd/omd b/omd/packages/omd/omd
index e88118e..a4daa44 100644
--- a/omd/packages/omd/omd
+++ b/omd/packages/omd/omd
@@ -2705,6 +2705,10 @@ def main_create(args, options=None):
config_settings["AUTOSTART"] = "off"
sys.stdout.write("Going to set AUTOSTART to off.\n")
+ if "no-tmpfs" in options:
+ config_settings["TMPFS"] = "off"
+ sys.stdout.write("Going to set TMPFS to off.\n")
+
if "no-init" not in options:
admin_password = init_site(config_settings, options)
welcome_message(admin_password)
@@ -4208,6 +4212,7 @@ commands = [
( "no-init", "n", False, "leave new site directory empty (a later omd init does this"),
( "no-autostart", "A", False, "set AUTOSTART to off (useful for test sites)"),
( "apache-reload", False, False, "Issue a reload of the system apache instead of a restart"),
+ ( "no-tmpfs", None, False, "set TMPFS to off"),
( "tmpfs-size", "t", True, "specify the maximum size of the tmpfs (defaults to 50% of RAM), examples: 500M, 20G, 60%"),
],
"Create a new site (-u UID, -g GID)",
diff --git a/omd/packages/omd/omd.8 b/omd/packages/omd/omd.8
index c3b6d6d..dd9e28a 100644
--- a/omd/packages/omd/omd.8
+++ b/omd/packages/omd/omd.8
@@ -102,6 +102,11 @@ the system Apache (/omd/apache/SITE.conf will be empty).
\fB--apache-reload\fP Issue a reaload of the apache process instead of the default restart
+\fB--no-tmpfs\fP Use this to set the omd config option TMPFS to off during site creation.
+This may be useful when sites are set-up where the use of temporary filesystems is not
+possible. However, it is still highly recommended to use a tmpfs for the sites \fBtmp\fP
+directory for best performance.
+
\fB-t SIZE\fP By default the tmpfs of the site is created to allocate 50% of
the available RAM at max. When providing the \fB-t\fP option together with the SIZE
given as absolute value of e.g. \fB500M\fP or percentage value like \fB10%\fP the
Module: check_mk
Branch: master
Commit: 85dd6b27269fc283103fd1584b3d1daab7869521
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=85dd6b27269fc2…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Fri Sep 14 10:46:26 2018 +0200
6503 FIX Fixed error handling for duplicate EC rule IDs.
Trying to insert an EC rule with an already existing ID resulted in a GUI
crash, this has been fixed.
Change-Id: If38a8c3067f003b212d403eb061af898c81951e6
---
.werks/6503 | 12 ++++++++++++
cmk/gui/wato/mkeventd.py | 4 ++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.werks/6503 b/.werks/6503
new file mode 100644
index 0000000..993308d
--- /dev/null
+++ b/.werks/6503
@@ -0,0 +1,12 @@
+Title: Fixed error handling for duplicate EC rule IDs.
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1536843614
+
+Trying to insert an EC rule with an already existing ID resulted in a GUI
+crash, this has been fixed.
diff --git a/cmk/gui/wato/mkeventd.py b/cmk/gui/wato/mkeventd.py
index 521890b..84ff85d 100644
--- a/cmk/gui/wato/mkeventd.py
+++ b/cmk/gui/wato/mkeventd.py
@@ -1957,8 +1957,8 @@ class ModeEventConsoleEditRule(EventConsoleMode):
for pack in self._rule_packs:
for r in pack["rules"]:
if r["id"] == self._rule["id"]:
- error_text = _("A rule with this ID already exists in rule pack <b>%s</b>.") % pack["title"]
- raise MKUserError("rule_p_id", error_text)
+ raise MKUserError("rule_p_id",
+ _("A rule with this ID already exists in rule pack <b>%s</b>.") % pack["title"])
try:
num_groups = re.compile(self._rule["match"]).groups
Module: check_mk
Branch: master
Commit: 163493ec54158eb168ea9f1be22e4d1f782fc37e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=163493ec54158e…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Sep 13 11:45:36 2018 +0200
6564 FIX Fixed incorrect rate computation affecting various checks in some cases
All previous 1.5 releases used a partially broken counter / rate computation in
various checks in specific situations, e.g. inotify checks. Not all check
results were computed wrong, only the ones based on counter / rate
computations.
When a single check monitors several services on a host, only the first of
these services was affected by this issue.
Change-Id: Ib7883c2684b14871a13151b2be11b6a35643dd8a
---
.werks/6564 | 17 +++++++++++++++++
cmk_base/checking.py | 6 ------
cmk_base/data_sources/host_sections.py | 5 +++++
cmk_base/item_state.py | 22 +++++++++++++++-------
4 files changed, 37 insertions(+), 13 deletions(-)
diff --git a/.werks/6564 b/.werks/6564
new file mode 100644
index 0000000..6c270dd
--- /dev/null
+++ b/.werks/6564
@@ -0,0 +1,17 @@
+Title: Fixed incorrect rate computation affecting various checks in some cases
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1536829823
+
+All previous 1.5 releases used a partially broken counter / rate computation in
+various checks in specific situations, e.g. inotify checks. Not all check
+results were computed wrong, only the ones based on counter / rate
+computations.
+
+When a single check monitors several services on a host, only the first of
+these services was affected by this issue.
diff --git a/cmk_base/checking.py b/cmk_base/checking.py
index 97a9919..22178b0 100644
--- a/cmk_base/checking.py
+++ b/cmk_base/checking.py
@@ -265,12 +265,6 @@ def execute_check(multi_host_sections, hostname, ipaddress, check_plugin_name, i
section_name = cmk_base.check_utils.section_name_of(check_plugin_name)
- # We need to set this again, because get_section_content has the side effect of setting this with
- # item None if there is a parse function. This would break the entire set_item/get_rate logic
- # for checks with items that rely on this being handled by the API.
- # TODO: Write a regression test for this.
- item_state.set_item_state_prefix(check_plugin_name, item)
-
dont_submit = False
section_content = None
try:
diff --git a/cmk_base/data_sources/host_sections.py b/cmk_base/data_sources/host_sections.py
index 82942e2..d3db705 100644
--- a/cmk_base/data_sources/host_sections.py
+++ b/cmk_base/data_sources/host_sections.py
@@ -252,6 +252,9 @@ class MultiHostSections(object):
if not parse_function:
return section_content
+ # TODO: Item state needs to be handled in local objects instead of the
+ # item_state._cached_item_states object
+ orig_item_state_prefix = item_state.get_item_state_prefix()
try:
item_state.set_item_state_prefix(section_name, None)
return parse_function(section_content)
@@ -259,6 +262,8 @@ class MultiHostSections(object):
if cmk.debug.enabled():
raise
raise MKParseFunctionError(*sys.exc_info())
+ finally:
+ item_state.set_item_state_prefix(*orig_item_state_prefix)
return section_content
diff --git a/cmk_base/item_state.py b/cmk_base/item_state.py
index 38975e8..590f22f 100644
--- a/cmk_base/item_state.py
+++ b/cmk_base/item_state.py
@@ -155,23 +155,27 @@ class CachedItemStates(object):
pass
+ def get_item_state(self, user_key, default=None):
+ key = self.get_unique_item_state_key(user_key)
+ return self._item_states.get(key, default)
+
+
def set_item_state(self, user_key, state):
key = self.get_unique_item_state_key(user_key)
self._item_states[key] = state
self._updated_item_states[key] = state
- def set_item_state_prefix(self, args):
- self._item_state_prefix = args
+ def get_all_item_states(self):
+ return self._item_states
- def get_item_state(self, user_key, default=None):
- key = self.get_unique_item_state_key(user_key)
- return self._item_states.get(key, default)
+ def get_item_state_prefix(self):
+ return self._item_state_prefix
- def get_all_item_states(self):
- return self._item_states
+ def set_item_state_prefix(self, args):
+ self._item_state_prefix = args
def get_unique_item_state_key(self, user_key):
@@ -237,6 +241,10 @@ def set_item_state_prefix(*args):
_cached_item_states.set_item_state_prefix(args)
+def get_item_state_prefix():
+ return _cached_item_states.get_item_state_prefix()
+
+
def _unique_item_state_key(user_key):
_cached_item_states.get_unique_item_state_key(user_key)