Module: check_mk
Branch: master
Commit: 74aeebe21362bc8f32c8549edbe7228a9d5edd15
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=74aeebe21362bc…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jul 24 11:50:49 2017 +0200
cmk: Prepare to support modes that do not load the checks
Change-Id: I1f3720a1ea146223c8fdb8af0e884938bfe64790
---
bin/check_mk | 7 ++++---
cmk_base/modes/__init__.py | 11 ++++++++++-
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/bin/check_mk b/bin/check_mk
index dfc73e7..9af3b38 100755
--- a/bin/check_mk
+++ b/bin/check_mk
@@ -75,10 +75,11 @@ except getopt.GetoptError, err:
# First load the general modifying options
modes.process_general_options(opts)
-# TODO: Why are we loading the checks in all modes? This is useless in some modes!
-# But at least in case the config is needed, the checks are needed too, because
+# At least in case the config is needed, the checks are needed too, because
# the configuration may refer to check config variable names.
-checks.load()
+if len(set.intersection(set(modes.non_config_options()),
+ [o[0] for o in opts])) == 0:
+ checks.load()
# Read the configuration files (main.mk, autochecks, etc.), but not for
# certain operation modes that does not need them and should not be harmed
diff --git a/cmk_base/modes/__init__.py b/cmk_base/modes/__init__.py
index ba1cdae..727f6af 100644
--- a/cmk_base/modes/__init__.py
+++ b/cmk_base/modes/__init__.py
@@ -141,6 +141,14 @@ class Modes(object):
return options
+ def non_checks_options(self):
+ options = []
+ for mode in self._modes:
+ if not mode.needs_checks:
+ options += mode.options()
+ return options
+
+
def parse_hostname_list(self, args, with_clusters=True, with_foreign_hosts=False):
if with_foreign_hosts:
valid_hosts = config.all_configured_realhosts()
@@ -293,13 +301,14 @@ class Option(object):
class Mode(Option):
def __init__(self, long_option, handler_function, short_help, short_option=None,
argument=False, argument_descr=None, argument_conv=None, argument_optional=False,
- long_help=None, needs_config=True, sub_options=None):
+ long_help=None, needs_config=True, needs_checks=True, sub_options=None):
# pylint: disable=bad-super-call
super(Mode, self).__init__(long_option, short_help, short_option, argument,
argument_descr, argument_conv, argument_optional,
handler_function=handler_function)
self.long_help = long_help
self.needs_config = needs_config
+ self.needs_checks = needs_checks
self.sub_options = sub_options or []
Module: check_mk
Branch: master
Commit: 91c9dd4447ec2cd72553ad1c72942ecc4075599a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=91c9dd4447ec2c…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Jul 24 14:59:13 2017 +0200
Updated bug entries #2902
Change-Id: I9fb371e603efa2e0da0feba38819889b554bb1e8
---
.bugs/2902 | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/.bugs/2902 b/.bugs/2902
index b10317f..cb04bcd 100644
--- a/.bugs/2902
+++ b/.bugs/2902
@@ -1,15 +1,8 @@
-Title: Agent bakery does not use local check plugins
-Component: core
+Title: Contact group inheritance in WATO
+Component: wato
State: open
-Date: 2017-05-11 11:55:19
-Targetversion: 1.5.0
-Class: feature
+Date: 2017-07-24 14:57:59
+Targetversion: future
+Class: nastiness
-To make this possible we need to abstract the source path for such files from the agent
-bakery plugins. We could wrap the paths in a function which detects the real path. Something
-like this:
-
-overridable_file_path("check_mk/agents/plugins/...")
-
-In case a local file is available it is used. Otherwise the regular file
-below share is used.
+See ticket #38 Uni-Leipzig
Module: check_mk
Branch: master
Commit: 4af123207b9b3dd52abfdddb458692cabc6ca7c6
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4af123207b9b3d…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Jul 24 12:51:16 2017 +0200
4853 FIX agent_netapp: Re-enabled some deprecated SSL Ciphers which were used in old 7mode filers
Our latest builtin python version removed the support for some SSL ciphers,
because they are considered deprecated/insecure.
These old ciphers are required, because some of the 7mode filers are unable to work with newer ciphers.
Change-Id: I1675b0601cae1f6267054f66ee553ef22470df94
---
.werks/4853 | 14 ++++++++++++++
agents/special/agent_netapp | 11 +++++++++++
2 files changed, 25 insertions(+)
diff --git a/.werks/4853 b/.werks/4853
new file mode 100644
index 0000000..1778c3e
--- /dev/null
+++ b/.werks/4853
@@ -0,0 +1,14 @@
+Title: agent_netapp: Re-enabled some deprecated SSL Ciphers which were used in old 7mode filers
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1500893070
+
+Our latest builtin python version removed the support for some SSL ciphers,
+because they are considered deprecated/insecure.
+
+These old ciphers are required, because some of the 7mode filers are unable to work with newer ciphers.
diff --git a/agents/special/agent_netapp b/agents/special/agent_netapp
index 334093d..77f2654 100755
--- a/agents/special/agent_netapp
+++ b/agents/special/agent_netapp
@@ -175,6 +175,17 @@ else:
except:
pass
+ requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS += ":" + ":".join([
+ "DH+3DES",
+ "DH+HIGH",
+ "ECDH+3DES",
+ "ECDH+HIGH",
+ "RSA+3DES",
+ "RSA+HIGH",
+ ])
+
+
+
try:
# lxml was quite promising in our test environment: Uses 2 times less CPU resources
# Unfortunaly, it is not a builtin module and need to be installed manually with
Module: check_mk
Branch: master
Commit: f81a29332490829b82d308a135ccdabd7a6f3df2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f81a2933249082…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Jul 24 10:51:39 2017 +0200
4852 FIX Livestatus connections: fixed bug where data from previous connection got reused
When using persistent connections, there was a risk that the response data from
previous livestatus queries got intermingled with the data from the latest query.
This caused quite a lot of confusing for most of the GUI plugins, which crashed occasionally.
Change-Id: Ib0629b08c1313a058f73339c60eb807ee9dc0ca6
---
.werks/4852 | 16 ++++++++++++++++
livestatus/api/python/livestatus.py | 30 +++++++++++++++++++-----------
2 files changed, 35 insertions(+), 11 deletions(-)
diff --git a/.werks/4852 b/.werks/4852
new file mode 100644
index 0000000..294ec72
--- /dev/null
+++ b/.werks/4852
@@ -0,0 +1,16 @@
+Title: Livestatus connections: fixed bug where data from previous connection got reused
+Level: 1
+Component: livestatus
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1500885870
+
+When using persistent connections, there was a risk that the response data from
+previous livestatus queries got intermingled with the data from the latest query.
+
+
+This caused quite a lot of confusing for most of the GUI plugins, which crashed occasionally.
+
diff --git a/livestatus/api/python/livestatus.py b/livestatus/api/python/livestatus.py
index 5df2c38..7098da2 100644
--- a/livestatus/api/python/livestatus.py
+++ b/livestatus/api/python/livestatus.py
@@ -315,7 +315,10 @@ class BaseConnection:
def disconnect(self):
self.socket = None
if self.persist:
- del persistent_connections[self.socketurl]
+ try:
+ del persistent_connections[self.socketurl]
+ except KeyError:
+ pass
def receive_data(self, size):
result = ""
@@ -384,6 +387,7 @@ class BaseConnection:
try:
length = int(resp[4:15].lstrip())
except:
+ self.disconnect()
raise MKLivestatusSocketError("Malformed output. Livestatus TCP socket might be unreachable.")
data = self.receive_data(length)
@@ -392,6 +396,7 @@ class BaseConnection:
try:
return ast.literal_eval(data)
except:
+ self.disconnect()
raise MKLivestatusSocketError("Malformed output")
elif code == "404":
@@ -424,6 +429,10 @@ class BaseConnection:
raise
except Exception, e:
+ # Catches
+ # MKLivestatusQueryError
+ # MKLivestatusSocketError
+ # FIXME: ? self.disconnect()
raise MKLivestatusSocketError("Unhandled exception: %s" % e)
@@ -722,6 +731,7 @@ class MultiSiteConnection(Helpers):
result += r
stillalive.append( (sitename, site, connection) )
except Exception, e:
+ connection.disconnect()
self.deadsites[sitename] = {
"exception" : e,
"site" : site,
@@ -733,13 +743,15 @@ class MultiSiteConnection(Helpers):
# of Limit: since all sites are queried in parallel, the Limit: is simply
# applied to all sites - resulting in possibly more results then Limit requests.
def query_parallel(self, query, add_headers = ""):
+ stillalive = []
if self.only_sites != None:
- active_sites = [ c for c in self.connections if c[0] in self.only_sites ]
+ connect_to_sites = [ c for c in self.connections if c[0] in self.only_sites ]
+ # Unused sites are assumed to be alive
+ stillalive.extend( [ c for c in self.connections if c[0] not in self.only_sites])
else:
- active_sites = self.connections
+ connect_to_sites = self.connections
start_time = time.time()
- stillalive = []
limit = self.limit
if limit != None:
limit_header = "Limit: %d\n" % limit
@@ -747,7 +759,7 @@ class MultiSiteConnection(Helpers):
limit_header = ""
# First send all queries
- for sitename, site, connection in active_sites:
+ for sitename, site, connection in connect_to_sites:
try:
connection.send_query(query, add_headers + limit_header)
except Exception, e:
@@ -764,11 +776,7 @@ class MultiSiteConnection(Helpers):
# Then retrieve all answers. We will be as slow as the slowest of all
# connections.
result = []
- for sitename, site, connection in self.connections:
- if self.only_sites != None and sitename not in self.only_sites:
- stillalive.append( (sitename, site, connection) ) # state unknown, assume still alive
- continue
-
+ for sitename, site, connection in connect_to_sites:
try:
r = connection.recv_response(query, add_headers + limit_header)
stillalive.append( (sitename, site, connection) )
@@ -780,12 +788,12 @@ class MultiSiteConnection(Helpers):
continue
except Exception, e:
+ connection.disconnect()
self.deadsites[sitename] = {
"exception" : e,
"site" : site,
}
-
self.connections = stillalive
return result