aboutsummaryrefslogtreecommitdiffstats
path: root/check-certificates
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2019-01-09 14:33:09 +0100
committerGravatar Christian Hesse <mail@eworm.de>2019-01-09 14:33:09 +0100
commitfe34a80a3d39bdeedb32e0f6ddf9a742b75a648f (patch)
tree90a84fb775c8966eed3f7894f0e8499d0a3e823e /check-certificates
parent1b9a277b4761a80c13acf6a12bf5ec4d25d531fc (diff)
check-certificates: include the issuer in notifications
Diffstat (limited to 'check-certificates')
-rw-r--r--check-certificates4
1 files changed, 4 insertions, 0 deletions
diff --git a/check-certificates b/check-certificates
index 72d6a5d..f0a466e 100644
--- a/check-certificates
+++ b/check-certificates
@@ -48,6 +48,7 @@
:local InvalidBefore [ / certificate get $CertNew invalid-before ];
:local InvalidAfter [ / certificate get $CertNew invalid-after ];
+ :local Issuer [ / certificate get $CertNew issuer ];
:set CommonName [ / certificate get $CertNew common-name ];
:set FingerPrint [ / certificate get $CertNew fingerprint ];
@@ -56,17 +57,20 @@
"Certificate Name: " . $CertName . "\n" . \
"Common Name: " . $CommonName . "\n" . \
"Fingerprint: " . $FingerPrint . "\n" . \
+ "Issuer: " . $Issuer . "\n" . \
"Validity: " . $InvalidBefore . " to " . $InvalidAfter);
:log info ("The certificate " . $CertName . " has been renewed.");
} on-error={
:local InvalidBefore [ / certificate get $Cert invalid-before ];
:local InvalidAfter [ / certificate get $Cert invalid-after ];
+ :local Issuer [ / certificate get $Cert issuer ];
$SendNotification ("Certificate warning!") \
("A certificate on " . $Identity . " is about to expire.\n\n" . \
"Certificate Name: " . $CertName . "\n" . \
"Common Name: " . $CommonName . "\n" . \
"Fingerprint: " . $FingerPrint . "\n" . \
+ "Issuer: " . $Issuer . "\n" . \
"Validity: " . $InvalidBefore . " to " . $InvalidAfter);
:log warning ("The certificate " . $CertName . " is about to expire in " . $ExpiresAfter . ".");
}