Skip to content

Commit

Permalink
Add expiration date of cert in error state
Browse files Browse the repository at this point in the history
  • Loading branch information
lconsuegra committed Oct 12, 2020
1 parent 542e314 commit 7af96ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
...
Expand Down
4 changes: 2 additions & 2 deletions ipahealthcheck_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

Expand Down Expand Up @@ -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))

Expand Down

0 comments on commit 7af96ea

Please sign in to comment.