mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-06-26 19:48:40 +02:00
check-certificates: include the issuer in notifications
This commit is contained in:
parent
1b9a277b47
commit
fe34a80a3d
1 changed files with 4 additions and 0 deletions
|
@ -48,6 +48,7 @@
|
||||||
|
|
||||||
:local InvalidBefore [ / certificate get $CertNew invalid-before ];
|
:local InvalidBefore [ / certificate get $CertNew invalid-before ];
|
||||||
:local InvalidAfter [ / certificate get $CertNew invalid-after ];
|
:local InvalidAfter [ / certificate get $CertNew invalid-after ];
|
||||||
|
:local Issuer [ / certificate get $CertNew issuer ];
|
||||||
:set CommonName [ / certificate get $CertNew common-name ];
|
:set CommonName [ / certificate get $CertNew common-name ];
|
||||||
:set FingerPrint [ / certificate get $CertNew fingerprint ];
|
:set FingerPrint [ / certificate get $CertNew fingerprint ];
|
||||||
|
|
||||||
|
@ -56,17 +57,20 @@
|
||||||
"Certificate Name: " . $CertName . "\n" . \
|
"Certificate Name: " . $CertName . "\n" . \
|
||||||
"Common Name: " . $CommonName . "\n" . \
|
"Common Name: " . $CommonName . "\n" . \
|
||||||
"Fingerprint: " . $FingerPrint . "\n" . \
|
"Fingerprint: " . $FingerPrint . "\n" . \
|
||||||
|
"Issuer: " . $Issuer . "\n" . \
|
||||||
"Validity: " . $InvalidBefore . " to " . $InvalidAfter);
|
"Validity: " . $InvalidBefore . " to " . $InvalidAfter);
|
||||||
:log info ("The certificate " . $CertName . " has been renewed.");
|
:log info ("The certificate " . $CertName . " has been renewed.");
|
||||||
} on-error={
|
} on-error={
|
||||||
:local InvalidBefore [ / certificate get $Cert invalid-before ];
|
:local InvalidBefore [ / certificate get $Cert invalid-before ];
|
||||||
:local InvalidAfter [ / certificate get $Cert invalid-after ];
|
:local InvalidAfter [ / certificate get $Cert invalid-after ];
|
||||||
|
:local Issuer [ / certificate get $Cert issuer ];
|
||||||
|
|
||||||
$SendNotification ("Certificate warning!") \
|
$SendNotification ("Certificate warning!") \
|
||||||
("A certificate on " . $Identity . " is about to expire.\n\n" . \
|
("A certificate on " . $Identity . " is about to expire.\n\n" . \
|
||||||
"Certificate Name: " . $CertName . "\n" . \
|
"Certificate Name: " . $CertName . "\n" . \
|
||||||
"Common Name: " . $CommonName . "\n" . \
|
"Common Name: " . $CommonName . "\n" . \
|
||||||
"Fingerprint: " . $FingerPrint . "\n" . \
|
"Fingerprint: " . $FingerPrint . "\n" . \
|
||||||
|
"Issuer: " . $Issuer . "\n" . \
|
||||||
"Validity: " . $InvalidBefore . " to " . $InvalidAfter);
|
"Validity: " . $InvalidBefore . " to " . $InvalidAfter);
|
||||||
:log warning ("The certificate " . $CertName . " is about to expire in " . $ExpiresAfter . ".");
|
:log warning ("The certificate " . $CertName . " is about to expire in " . $ExpiresAfter . ".");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue