Module: check_mk
Branch: master
Commit: ea3700913e83167e2896cf3c2ce377db3ac5b240
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ea3700913e8316…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Apr 30 07:30:45 2018 +0200
6050 FIX Analyze configuration: Execute CMC specific tests only with CMC
Change-Id: I37593460281cf299992710cf8848959f884b3bd0
---
.werks/6050 | 11 +++++++++++
cmk/gui/plugins/wato/ac_tests.py | 30 ++++++++++++++++++++++--------
2 files changed, 33 insertions(+), 8 deletions(-)
diff --git a/.werks/6050 b/.werks/6050
new file mode 100644
index 0000000..7fb5eac
--- /dev/null
+++ b/.werks/6050
@@ -0,0 +1,11 @@
+Title: Analyze configuration: Execute CMC specific tests only with CMC
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1525034508
+
+
diff --git a/cmk/gui/plugins/wato/ac_tests.py b/cmk/gui/plugins/wato/ac_tests.py
index 6241bdb..2e53182 100644
--- a/cmk/gui/plugins/wato/ac_tests.py
+++ b/cmk/gui/plugins/wato/ac_tests.py
@@ -24,6 +24,7 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
+import abc
import requests
import subprocess
@@ -416,8 +417,21 @@ class ACTestBackupNotEncryptedConfigured(ACTest):
-# Abstract base class for apache related tests
-class BPApacheTest(object):
+class ACMicrocoreTest(object):
+ """Abstract base class for microcore specific tests"""
+ __metaclass__ = abc.ABCMeta
+
+ def _uses_microcore(self):
+ local_connection = sites.livestatus.LocalConnection()
+ version = local_connection.query_value("GET status\nColumns:
program_version\n", deflt="")
+ return version.startswith("Check_MK")
+
+
+
+class ACApacheTest(object):
+ """Abstract base class for apache related tests"""
+ __metaclass__ = abc.ABCMeta
+
def _get_number_of_idle_processes(self):
apache_status = self._get_apache_status()
@@ -449,7 +463,7 @@ class BPApacheTest(object):
-class ACTestApacheNumberOfProcesses(ACTest, BPApacheTest):
+class ACTestApacheNumberOfProcesses(ACTest, ACApacheTest):
def category(self):
return ACTestCategories.performance
@@ -533,7 +547,7 @@ class ACTestApacheNumberOfProcesses(ACTest, BPApacheTest):
-class ACTestApacheProcessUsage(ACTest, BPApacheTest):
+class ACTestApacheProcessUsage(ACTest, ACApacheTest):
def category(self):
return ACTestCategories.performance
@@ -575,7 +589,7 @@ class ACTestApacheProcessUsage(ACTest, BPApacheTest):
-class ACTestCheckMKHelperUsage(ACTest):
+class ACTestCheckMKHelperUsage(ACTest, ACMicrocoreTest):
def category(self):
return ACTestCategories.performance
@@ -606,7 +620,7 @@ class ACTestCheckMKHelperUsage(ACTest):
def is_relevant(self):
- return True
+ return self._uses_microcore()
def execute(self):
@@ -655,7 +669,7 @@ class ACTestCheckMKHelperUsage(ACTest):
-class ACTestGenericCheckHelperUsage(ACTest):
+class ACTestGenericCheckHelperUsage(ACTest, ACMicrocoreTest):
def category(self):
return ACTestCategories.performance
@@ -679,7 +693,7 @@ class ACTestGenericCheckHelperUsage(ACTest):
def is_relevant(self):
- return True
+ return self._uses_microcore()
def execute(self):