Module: check_mk
Branch: master
Commit: 5d16051a5b90899a5e13c9c7797e7525e2c3b3ff
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5d16051a5b9089…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jul 2 10:31:38 2018 +0200
6280 Analyze configuration: Add performance test for mounted tmpfs
---
.werks/6280 | 10 ++++++++++
web/plugins/wato/ac_tests.py | 47 ++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 57 insertions(+)
diff --git a/.werks/6280 b/.werks/6280
new file mode 100644
index 0000000..b342f37
--- /dev/null
+++ b/.werks/6280
@@ -0,0 +1,10 @@
+Title: Analyze configuration: Add performance test for mounted tmpfs
+Level: 1
+Component: wato
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1530520260
+Class: feature
+
+
diff --git a/web/plugins/wato/ac_tests.py b/web/plugins/wato/ac_tests.py
index 6541a0c..f73b850 100644
--- a/web/plugins/wato/ac_tests.py
+++ b/web/plugins/wato/ac_tests.py
@@ -158,6 +158,53 @@ class ACTestLivestatusUsage(ACTest):
+class ACTestTmpfs(ACTest):
+ def category(self):
+ return ACTestCategories.performance
+
+
+ def title(self):
+ return _("Temporary filesystem mounted")
+
+
+ def help(self):
+ return _("<p>By default each Check_MK site has it's own temporary filesystem "
+ "(a ramdisk) mounted to <tt>[SITE]/tmp</tt>. In case the mount is not "
+ "possible Check_MK starts without this temporary filesystem.</p>"
+ "<p>Even if this is possible, it is not recommended to use Check_MK this "
+ "way because it may reduce the overall performance of Check_MK.</p>")
+
+
+ def is_relevant(self):
+ return True
+
+
+ def execute(self):
+ if self._tmpfs_mounted(config.omd_site()):
+ yield ACResultOK(_("The temporary filesystem is mounted"))
+ else:
+ yield ACResultWARN(_("The temporary filesystem is not mounted. Your installation "
+ "may work with degraded performance."))
+
+
+ def _tmpfs_mounted(self, site_id):
+ # Borrowed from omd binary
+ #
+ # Problem here: if /omd is a symbolic link somewhere else,
+ # then in /proc/mounts the physical path will appear and be
+ # different from tmp_path. We just check the suffix therefore.
+ path_suffix = "sites/%s/tmp" % site_id
+ for line in file("/proc/mounts"):
+ try:
+ device, mp, fstype, options, dump, fsck = line.split()
+ if mp.endswith(path_suffix) and fstype == 'tmpfs':
+ return True
+ except:
+ continue
+ return False
+
+
+
class ACTestLDAPSecured(ACTest):
def category(self):
return ACTestCategories.security
Module: check_mk
Branch: master
Commit: 7791039016012fec03b23ad5618c275ac57494cc
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7791039016012f…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jul 2 10:37:47 2018 +0200
6284 FIX Removed dangerous "omd uninstall" mode
This mode was only used during early development. When being executed
on a system where Check_MK is installed through OS packages, it left
the package manager in a bad state where the OMD files are gone but
package meta information are still left.
---
.werks/6284 | 13 +++++++++++++
omd/packages/omd/omd | 30 ------------------------------
omd/packages/omd/omd.8 | 9 ---------
3 files changed, 13 insertions(+), 39 deletions(-)
diff --git a/.werks/6284 b/.werks/6284
new file mode 100644
index 0000000..90c3c4b
--- /dev/null
+++ b/.werks/6284
@@ -0,0 +1,13 @@
+Title: Removed dangerous "omd uninstall" mode
+Level: 1
+Component: omd
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1530520594
+Class: fix
+
+This mode was only used during early development. When being executed
+on a system where Check_MK is installed through OS packages, it left
+the package manager in a bad state where the OMD files are gone but
+package meta information are still left.
diff --git a/omd/packages/omd/omd b/omd/packages/omd/omd
index 4862ea9..5fadb09 100644
--- a/omd/packages/omd/omd
+++ b/omd/packages/omd/omd
@@ -2486,29 +2486,6 @@ def main_help(args=None, options=None):
)
-def main_uninstall(args, options=None):
- if options is None:
- options = {}
-
- global g_sitename
- global g_sitedir
- for sitename in all_sites():
- g_sitename = sitename
- g_sitedir = site_dir(g_sitename)
- main_rm([])
-
- for path in [ g_info["OMD_PHYSICAL_BASE"],
- "/omd",
- g_info["APACHE_CONF_DIR"] + "/zzz_omd.conf",
- "/etc/init.d/omd",
- "/usr/bin/omd" ]:
- shutil.rmtree(path, ignore_errors=True)
-
- groupdel('omd')
-
- sys.stdout.write("Good bye.\n")
-
-
def main_setversion(args, options=None):
if options is None:
options = {}
@@ -4033,13 +4010,6 @@ commands = [
"Show general help",
""),
- ( "uninstall", True, False, 0, 0, True, "", main_uninstall,
- [],
- "Remove OMD and all sites!",
-
- "BE WARNED: You are about to remove everything your system\n"
- " have ever known about omd."),
-
( "setversion", True, False, 0, 0, False, "VERSION", main_setversion,
[],
"Sets the default version of OMD which will be used by new sites",
diff --git a/omd/packages/omd/omd.8 b/omd/packages/omd/omd.8
index b3b155a..5e6d393 100644
--- a/omd/packages/omd/omd.8
+++ b/omd/packages/omd/omd.8
@@ -68,15 +68,6 @@ This mainly updates the symlink \fB/omd/versions/default\fP. On debian based dis
it calls update-alternatives to change the default versions. In this case there is a special
option \fBauto\fP available to let update-alternatives choose the default OMD version.
.TP
-.B omd uninstall
-This deletes all software and data of OMD and its sites. That command is mainly used
-for trying out OMD or testing the installation of OMD. Be aware that
-all your monitoring configuration and data will be lost!
-
-Note: Do not use \fBomd uninstall\fP if you've installed omd via RPM or DEB.
-Better remove all sites via by using \fBomd rm\fP and remove the RPM/DEB
-package afterwards.
-.TP
.B omd sites [--bare, -b]
Show a list of all sites and the version of OMD each site uses. If you specify
the option \fB-b\fP or \fB--bare\fP, then the output leaves out hints to the