mirror of
https://github.com/Luzifer/promcertcheck.git
synced 2024-11-09 16:30:04 +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 {
|
switch verificationResult {
|
||||||
case certificateExpiresSoon, certificateOK:
|
case certificateExpiresSoon, certificateOK:
|
||||||
probeMonitors[probeURL.Host].IsValid.Set(1)
|
probeMonitors[probeURL.Host].IsValid.Set(1)
|
||||||
|
|
Loading…
Reference in a new issue