1
0
Fork 0
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:
Knut Ahlers 2016-01-26 00:36:08 +01:00
parent b7bee41940
commit 83fc7dcba5

View file

@ -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)