diff --git a/README.md b/README.md index 21aca9e..09738c1 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Usage of ./ipa-healthcheck_exporter: ## Exported Metrics ``` -# HELP ipa_cert_expiration Expiration date of the certificates in warning state (unix timestamp) +# HELP ipa_cert_expiration Expiration date of the certificates in warning or error state (unix timestamp) # TYPE ipa_cert_expiration gauge ipa_cert_expiration{certificate_request_id="20200626075943"} 1.604761504e+09 ... diff --git a/ipahealthcheck_exporter.go b/ipahealthcheck_exporter.go index 0dc79a6..a4a0c43 100644 --- a/ipahealthcheck_exporter.go +++ b/ipahealthcheck_exporter.go @@ -42,7 +42,7 @@ var ( ipahealthcheckCertExpirationDesc = prometheus.NewDesc( "ipa_cert_expiration", - "Expiration date of the certificates in warning state (unix timestamp)", + "Expiration date of the certificates in warning or error state (unix timestamp)", []string{"certificate_request_id"}, nil, ) @@ -138,7 +138,7 @@ func (ic ipahealthcheckCollector) Collect(ch chan<- prometheus.Metric) { if check.Source == "ipahealthcheck.ipa.certs" && check.Check == "IPACertmongerExpirationCheck" { - if check.Result == "WARNING" { + if check.Result == "WARNING" || check.Result == "ERROR" { timestamp, err := time.Parse("20060102150405Z", check.Kw["expiration_date"].(string))