mirror of
https://github.com/Luzifer/promcertcheck.git
synced 2024-11-08 07:50:05 +00:00
Only set expiry when valid cert
This commit is contained in:
parent
b7bee41940
commit
83fc7dcba5
1 changed files with 4 additions and 1 deletions
5
main.go
5
main.go
|
@ -120,7 +120,10 @@ func refreshCertificateStatus() {
|
|||
}
|
||||
}
|
||||
|
||||
probeMonitors[probeURL.Host].Expires.Set(float64(verifyCert.NotAfter.UTC().Unix()))
|
||||
if verifyCert != nil {
|
||||
probeMonitors[probeURL.Host].Expires.Set(float64(verifyCert.NotAfter.UTC().Unix()))
|
||||
}
|
||||
|
||||
switch verificationResult {
|
||||
case certificateExpiresSoon, certificateOK:
|
||||
probeMonitors[probeURL.Host].IsValid.Set(1)
|
||||
|
|
Loading…
Reference in a new issue