cert
Reference for the `cert` collector.
cert· collector · runnanook doc certfor the same content in your terminal.
Reads the TLS leaf certificate from a host and reports expiry signals.
Options
| Option | Type | Default | Description |
|---|---|---|---|
host | string | required | target hostname or IP |
port | string | 443 | target port |
server_name | string | — | SNI override (defaults to host when it parses as a DNS name) |
timeout | string | 10s | dial + handshake timeout (e.g. 5s) |
Metrics
| Metric | Kind | Unit | Description |
|---|---|---|---|
cert.handshake_ok | bool | — | true if the TLS handshake completed. Labels: addr. |
cert.days_until_expiry | numeric | — | days remaining before the leaf cert not_after. Negative once expired. Labels: addr. |
cert.not_after | numeric | seconds | leaf cert not_after as seconds since the unix epoch. Labels: addr. |
cert.not_before | numeric | seconds | leaf cert not_before as seconds since the unix epoch. Labels: addr. |
cert.valid | bool | — | true when current time is within [not_before, not_after]. Labels: addr. |
Examples
Watch a TLS endpoint
[[]]
= "api-cert"
= "cert"
= 3600
[]
= "api.example.com"
= 443
= "10s"
Alert weeks before expiry
[[]]
= "api-cert::cert.days_until_expiry < 14"
= 1
= "ops"
= { = 86400, = "oncall" }
Catch handshake failures
[[]]
= 'api-cert::cert.handshake_ok is "false"'
= 3
= "ops"
SNI override
[]
= "10.0.0.42"
= 443
= "api.example.com"