Module: check_mk
Branch: master
Commit: fcb7d0269ae0cb7009f14f63d24df6c32d7bb9df
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fcb7d0269ae0cb…
Author: Moritz Kiemer <mo(a)mathias-kettner.de>
Date: Tue Nov 13 09:26:45 2018 +0100
6902 FIX apache_status: Ignore certificate for localhost
If a https server at 127.0.0.1 or [::1] is checked, ignore the certificate in
case the name does not match.
Previously we tried to contact the server via http on port 80 instead,
but the server may not be listening on that port.
You need to change the protocol to http if you are monitoring a https
server that also listenes on port 80 and the servers address is not
either the address the certificate was issued for or one of
127.0.0.1, [::1] and "localhost".
Change-Id: I2db8af14aeb238494e558358c07d27f7733fa8cb
---
.werks/6902 | 19 +++++++++++++++++++
agents/plugins/apache_status | 14 +++++++-------
2 files changed, 26 insertions(+), 7 deletions(-)
diff --git a/.werks/6902 b/.werks/6902
new file mode 100644
index 0000000..4c5eb7e
--- /dev/null
+++ b/.werks/6902
@@ -0,0 +1,19 @@
+Title: apache_status: Ignore certificate for localhost
+Level: 1
+Component: checks
+Compatible: incomp
+Edition: cre
+Version: 1.6.0i1
+Date: 1542097441
+Class: fix
+
+If a https server at 127.0.0.1 or [::1] is checked, ignore the certificate in
+case the name does not match.
+
+Previously we tried to contact the server via http on port 80 instead,
+but the server may not be listening on that port.
+
+You need to change the protocol to http if you are monitoring a https
+server that also listenes on port 80 and the servers address is not
+either the address the certificate was issued for or one of
+127.0.0.1, [::1] and "localhost".
diff --git a/agents/plugins/apache_status b/agents/plugins/apache_status
index 07e7de3..693a31c 100755
--- a/agents/plugins/apache_status
+++ b/agents/plugins/apache_status
@@ -46,6 +46,7 @@ import re
import socket
import sys
import urllib2
+import ssl
config_dir = os.getenv("MK_CONFDIR", "/etc/check_mk")
config_file = config_dir + "/apache_status.conf"
@@ -62,9 +63,7 @@ socket.setdefaulttimeout(5.0)
# None or list of (proto, ipaddress, port) tuples.
# proto is 'http' or 'https'
servers = None
-ssl_ports = [
- 443,
-]
+ssl_ports = [443]
if os.path.exists(config_file):
execfile(config_file)
@@ -150,12 +149,13 @@ for server in servers:
else:
raise
except Exception, e:
- if 'doesn\'t match' in str(e):
+ if 'doesn\'t match' in str(e) and address in ("127.0.0.1", "[::1]", "localhost"):
# HACK: workaround if SSL port is found and localhost is using
# SSL connections but certificate does not match
- portspec = ':80'
- url = 'http://%s%s/server-status?auto' % (address, portspec)
- fd = urllib2.urlopen(url)
+ no_cert_context = ssl.create_default_context()
+ no_cert_context.check_hostname = False
+ no_cert_context.verify_mode = ssl.CERT_NONE
+ fd = urllib2.urlopen(url, context=no_cert_context)
else:
raise
Module: check_mk
Branch: master
Commit: da2a25a9cc400f96547eb9409d5198090218d70a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=da2a25a9cc400f…
Author: Óscar Nájera <on(a)mathias-kettner.de>
Date: Mon Nov 12 15:49:08 2018 +0100
6649 PagerDuty: Notification plugin
Check_MK now support native integration with Pager Duty and can send
notifications about state changes of hosts and services into a configured
Pager Duty service.
In Pager Duty a new integration service has to be set up. Select as
"Integration Type" Check_MK and configure your service as better suited for
your use case. Save the returned "Integration Key".
In Check_MK, under "WATO - Notifications", create an new notification rule
and select PagerDuty. Copy the "Integration Key" from Pager Duty as
parameter. Optionally you can save the integration key in Check_MK's
password manager and retrieve it here. If you want incidents in Pager Duty
to include hyperlinks back to Check_MK, enable the field URL prefix for
links to Check_MK.
CMK-1236
Change-Id: If4db68111dc98e8c771d1703f8a6d14bf51428eb
---
.werks/6649 | 23 ++++++
cmk/gui/plugins/wato/notifications.py | 51 ++++++++++++
cmk/notification_plugins/pagerduty.py | 108 +++++++++++++++++++++++++
cmk/notification_plugins/utils.py | 53 ++++++++----
notifications/pagerduty | 9 +++
tests/unit/cmk/notifications/test_pagerduty.py | 81 +++++++++++++++++++
tests/unit/cmk/notifications/test_utils.py | 10 +++
7 files changed, 320 insertions(+), 15 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=da2a25a9cc…