Skip to content

Commit 747df08

Browse files
committed
Add riemann-tls-check to monitor TLS resources
Add a riemann-tls-check that accept a list of URI of resources to check TLS certificates. For each URI, resolve the IP addresses that provide the service, and for each IP address generate 6 events for: 1. availability: state (reachability + status of all the following metrics); 2. not after: state + metric (number of seconds until the certificate is expired); 3. not before: state + metric (number of seconds since the certificate is valid); 4. identity: state (certificate subject match the URI hostname); 5. trust: state (validity of the certificate trust chain); 6. OCSP satus: state (validity of the OCSP status if applicable). A STARTTLS handshake is automatically done for imap://, ldap:// and smtp://; a protocol specific handshake is done for mysql:// and postgres:// URI.
1 parent d2b38d7 commit 747df08

File tree

7 files changed

+727
-8
lines changed

7 files changed

+727
-8
lines changed

bin/riemann-tls-check

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env ruby
2+
# frozen_string_literal: true
3+
4+
Process.setproctitle($PROGRAM_NAME)
5+
6+
require 'riemann/tools/tls_check'
7+
8+
Riemann::Tools::TLSCheck.run

lib/riemann/tools.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,13 @@ def run
9797
end
9898

9999
def tick; end
100+
101+
def endpoint_name(address, port)
102+
if address.ipv6?
103+
"[#{address}]:#{port}"
104+
else
105+
"#{address}:#{port}"
106+
end
107+
end
100108
end
101109
end

lib/riemann/tools/http_check.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -323,14 +323,6 @@ def redact_uri(uri)
323323
reported_uri.password = '**redacted**' if reported_uri.password
324324
reported_uri
325325
end
326-
327-
def endpoint_name(address, port)
328-
if address.ipv6?
329-
"[#{address}]:#{port}"
330-
else
331-
"#{address}:#{port}"
332-
end
333-
end
334326
end
335327
end
336328
end

0 commit comments

Comments
 (0)