Add an option for using starttls to probe ssl-expiration - reed-alert - Lightweight agentless alerting system for server HTML git clone git://bitreich.org/reed-alert/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/reed-alert/ DIR Log DIR Files DIR Refs DIR Tags DIR README DIR LICENSE --- DIR commit 8b2407ed4b3be6ef0baf6acd5ff3f01a0879ef9e DIR parent 64185e6f15946e6842a082578a778184a99a3abd HTML Author: Solene Rapenne <solene@perso.pw> Date: Sun, 21 Oct 2018 21:39:30 +0200 Add an option for using starttls to probe ssl-expiration Original code from Denis Fondras Diffstat: M probes.lisp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) --- DIR diff --git a/probes.lisp b/probes.lisp @@ -53,10 +53,10 @@ (defun system-load(time) (read-from-string - (let ((command (concatenate 'string - "uptime | awk '{ print $(NF-" - (princ-to-string time) - ") }'"))) + (let ((command (strcat + "uptime | awk '{ print $(NF-" + (princ-to-string time) + ") }'"))) (uiop:run-program command :output :string)))) (create-probe @@ -124,11 +124,13 @@ (create-probe ssl-expiration (command-return-code - (concatenate 'string - "echo | openssl s_client -showcerts -servername " - (getf params :host) " -connect " - (getf params :host) ":" (princ-to-string - (getf params :port 443)) - " 2>/dev/null | openssl x509 -inform pem -noout -checkend " - (princ-to-string - (getf params :seconds))))) + (let ((host (getf params :host)) + (port (princ-to-string (getf params :port 443))) + (seconds (princ-to-string (getf params :seconds))) + (starttls (getf params :starttls))) + (strcat + "echo | openssl s_client -showcerts -servername " host + " -connect " host ":" port " 2>/dev/null |" + "openssl x509 -inform pem -noout " + (when starttls (strcat " -starttls " starttls)) + " -checkend " seconds))))