Skip to content

Commit 08e8fa9

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 649770d commit 08e8fa9

File tree

7 files changed

+746
-8
lines changed

7 files changed

+746
-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
@@ -101,5 +101,13 @@ def run
101101
end
102102

103103
def tick; end
104+
105+
def endpoint_name(address, port)
106+
if address.ipv6?
107+
"[#{address}]:#{port}"
108+
else
109+
"#{address}:#{port}"
110+
end
111+
end
104112
end
105113
end

lib/riemann/tools/http_check.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -348,14 +348,6 @@ def redact_uri(uri)
348348
reported_uri.password = '**redacted**' if reported_uri.password
349349
reported_uri
350350
end
351-
352-
def endpoint_name(address, port)
353-
if address.ipv6?
354-
"[#{address}]:#{port}"
355-
else
356-
"#{address}:#{port}"
357-
end
358-
end
359351
end
360352
end
361353
end

0 commit comments

Comments
 (0)