Module: check_mk
Branch: master
Commit: b151525b08ce322cb784214884abce99c85ba87a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b151525b08ce32…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Aug 1 17:35:07 2018 +0200
Cleaned up star import for visuals plugins
Change-Id: I944d3f6f54cd07a48ea021f1d034502355eb034f
---
cmk/gui/plugins/visuals/__init__.py | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/cmk/gui/plugins/visuals/__init__.py b/cmk/gui/plugins/visuals/__init__.py
index 2ef2cb1..6fc5b95 100644
--- a/cmk/gui/plugins/visuals/__init__.py
+++ b/cmk/gui/plugins/visuals/__init__.py
@@ -40,10 +40,16 @@ __all__ = [ os.path.basename(f)[:-3] for f in modules if f not in [ "__init__.py
# | |___/ |
# '----------------------------------------------------------------------'
-# TODO: Would be better to replace this star import with an explicit list of
-# names needed for the plugins. Then we would have something like an official
-# plugin API. At least a list of names that are intended to be used by plugins.
-from cmk.gui.plugins.visuals.utils import *
+from cmk.gui.plugins.visuals.utils import (
+ declare_filter,
+ declare_info,
+ Filter,
+ FilterSite,
+ FilterTime,
+ FilterTristate,
+ FilterUnicodeFilter,
+ visual_types,
+)
#.
# .--Plugins-------------------------------------------------------------.
Module: check_mk
Branch: master
Commit: 520c24f983561699761413103e1a303c0e725577
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=520c24f9835616…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Aug 2 09:44:33 2018 +0200
6419 FIX agent_3par: Prevent InsecureRequestWarning error when ignoring SSL cert issues
In previous 1.5 releases the 3par special agent could report errors like
this:
CRIT - [special_3par] Agent exited with code 1:
/omd/sites/debsg/lib/python/requests/packages/urllib3/connectionpool.py:852:
InsecureRequestWarning: Unverified HTTPS request is being made. Adding
certificate verification is strongly advised. See
When a special agent is told to ignore SSL issues (like it's done always for
this agent) such warnings should be suppressed.
Change-Id: I0cc1ea0d434fbad725807aece484664dbe838aa1
---
.werks/6419 | 20 ++++++++++++++++++++
agents/special/agent_3par | 15 ++++++++++-----
2 files changed, 30 insertions(+), 5 deletions(-)
diff --git a/.werks/6419 b/.werks/6419
new file mode 100644
index 0000000..a41e3d5
--- /dev/null
+++ b/.werks/6419
@@ -0,0 +1,20 @@
+Title: agent_3par: Prevent InsecureRequestWarning error when ignoring SSL cert issues
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1533195825
+
+In previous 1.5 releases the 3par special agent could report errors like
+this:
+
+CRIT - [special_3par] Agent exited with code 1:
+/omd/sites/debsg/lib/python/requests/packages/urllib3/connectionpool.py:852:
+InsecureRequestWarning: Unverified HTTPS request is being made. Adding
+certificate verification is strongly advised. See
+
+When a special agent is told to ignore SSL issues (like it's done always for
+this agent) such warnings should be suppressed.
diff --git a/agents/special/agent_3par b/agents/special/agent_3par
index d949983..90c2d60 100755
--- a/agents/special/agent_3par
+++ b/agents/special/agent_3par
@@ -24,11 +24,14 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-import sys, getopt, requests
-try:
- import simplejson as json
-except:
- import json
+import getopt
+import json
+import sys
+
+import requests
+from requests.packages.urllib3.exceptions import \
+ InsecureRequestWarning # pylint: disable=import-error
+
# .--Arguments-----------------------------------------------------------.
# | _ _ |
@@ -104,7 +107,9 @@ headers = {
"Content-Type": "application/json",
"Accept": "application/json",
}
+
verify = False
+requests.packages.urllib3.disable_warnings(InsecureRequestWarning) # pylint: disable=no-member
# Initiate connection and get session Key. The api expects the login data
# in json format. The standard port for all requests is 8080 as it is hard