Module: check_mk
Branch: master
Commit: 508be27694397d906bd403ccf665c8facd791f98
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=508be27694397d…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Fri Feb 15 13:40:53 2019 +0100
mk_jolokia.py: suppress InsecureRequestWarning
CMK-648
Change-Id: Ib436ae56ea701a231a63e0528b5e8eca0ae3b7be
---
agents/plugins/mk_jolokia.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/agents/plugins/mk_jolokia.py b/agents/plugins/mk_jolokia.py
index df8ca52..af6abfd 100755
--- a/agents/plugins/mk_jolokia.py
+++ b/agents/plugins/mk_jolokia.py
@@ -45,6 +45,7 @@ except ImportError as import_error:
try:
import requests
from requests.auth import HTTPDigestAuth
+ from requests.packages import urllib3
except ImportError as import_error:
sys.stdout.write("<<<jolokia_info>>>\n"
"Error: mk_jolokia requires the requests library."
@@ -279,6 +280,8 @@ class JolokiaInstance(object):
def _initialize_http_session(self):
session = requests.Session()
session.verify = self._config["verify"]
+ if session.verify is False:
+ urllib3.disable_warnings(category=urllib3.exceptions.InsecureRequestWarning)
session.timeout = self._config["timeout"]
auth_method = self._config.get("mode")