Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lfuelling/ssl-exporter
A simple prometheus exporter that returns the NotBefore and NotAfter properties for a list of given domains.
https://github.com/lfuelling/ssl-exporter
golang prometheus prometheus-exporter ssl ssl-certificate ssl-certificates ssl-exporter
Last synced: 19 days ago
JSON representation
A simple prometheus exporter that returns the NotBefore and NotAfter properties for a list of given domains.
- Host: GitHub
- URL: https://github.com/lfuelling/ssl-exporter
- Owner: lfuelling
- License: mit
- Created: 2020-06-07T22:05:13.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-11-15T14:55:09.000Z (about 2 months ago)
- Last Synced: 2024-12-13T13:44:00.606Z (21 days ago)
- Topics: golang, prometheus, prometheus-exporter, ssl, ssl-certificate, ssl-certificates, ssl-exporter
- Language: Go
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ssl-exporter
A simple prometheus exporter that returns the `NotBefore` and `NotAfter` properties of the primary certificate for a list of given domains.
## Usage
1. Clone repo
2. Build (`go build -o exporter main.go`)
3. Configure
- See `config-example.json` for default values
- Save changed version as `config.json` in working directory
4. Run (`./exporter`)
- Or `./exporter -config ~/config.json` if the config is somewhere else.
5. (Optional) You can use the `example-systemd.service` file to create the service.
- Make sure you edit the placeholder values to fit your setup!### Queries
- You can view the validity of all your configured domains using a query like:
- `cert_not_after - time()`
- To view the soonest expiring certificate (for example to use in a singlestat panel):
- `bottomk(1, sum by (domain) (cert_not_after - time()))`### Example response
```
# HELP cert_not_before The primary certificates NotBefore date as unix time'.
# TYPE cert_not_before gauge
cert_not_before{domain="example.com"} 1592149450
# HELP cert_not_after The primary certificates NotAfter date as unix time'.
# TYPE cert_not_after gauge
cert_not_after{domain="example.com"} 1599925450
# HELP cert_fetch_duration Duration of the http call in nanoseconds.
# TYPE cert_fetch_duration gauge
cert_fetch_duration{domain="example.com"} 482473832
# HELP cert_fetch_success Success of the http call as a 0/1 boolean.
# TYPE cert_fetch_success gauge
cert_fetch_success{domain="example.com"} 1
```