ntppool-exporter/README.md

69 lines
2.3 KiB
Markdown
Raw Permalink Normal View History

2024-04-17 15:20:58 +02:00
# ntppool.org Exporter
2024-04-13 10:13:29 +02:00
2024-04-17 15:20:58 +02:00
This exporter is @adoralaura s try to display server scores from servers in [ntppool.org](https://www.ntppool.org) in a format which [Prometheus](https://prometheus.io/) can ingest.
2024-04-13 10:13:29 +02:00
2024-04-17 15:20:58 +02:00
# Usage
2024-04-13 10:13:29 +02:00
2024-04-17 15:20:58 +02:00
## Installation
2024-04-13 10:13:29 +02:00
2024-04-19 12:07:41 +02:00
Pre-built docker images can be found at [Docker Hub](https://hub.docker.com/r/lauralani/ntppool-exporter). A sample `docker-compose.yml` can be [found here](docker-compose.yml).
Binaries can be built by cloning this repository and run `go build main.go` with [Golang](https://go.dev/) installed.
2024-04-13 10:13:29 +02:00
2024-04-17 15:20:58 +02:00
## Running
2024-04-13 10:13:29 +02:00
2024-04-17 15:20:58 +02:00
Start `ntppool-exporter` as a daemon or from CLI:
2024-04-13 10:13:29 +02:00
2024-04-17 15:20:58 +02:00
```sh
./ntppool-exporter
```
2024-04-13 10:13:29 +02:00
2024-04-17 15:20:58 +02:00
Visit <http://localhost:43609/metrics?target=192.0.0.8> where `192.0.0.8` is the IP
of the NTP server you want to get the score from.
## Prometheus Configuration
The URL parameter `target` can be controlled through relabelling.
Example config:
```YAML
scrape_configs:
- job_name: 'ntppool'
static_configs:
- targets:
- 192.168.1.2
- 2003:db8::1
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: 127.0.0.1:43609 # The ntppool exporter's real hostname:port.
```
2024-04-13 10:13:29 +02:00
2024-04-17 15:20:58 +02:00
Similarly to [blackbox_exporter](https://github.com/prometheus/blackbox_exporter),
`ntppool-exporter` is meant to run on a few central machines and can be thought of
like a "Prometheus proxy".
2024-04-13 10:13:29 +02:00
2024-04-17 15:20:58 +02:00
### TLS and basic authentication
2024-04-13 10:13:29 +02:00
2024-04-17 15:20:58 +02:00
The ntppool Exporter does **not** support TLS and basic authentication yet.
This may be added in a future release.
2024-04-13 10:13:29 +02:00
2024-04-17 15:20:58 +02:00
## Scaling
2024-04-13 10:13:29 +02:00
2024-04-17 15:20:58 +02:00
A single instance of `ntppool-exporter` should be able to query for a lot of servers. However, rate limits for upstream `ntppool.org` API endpoints may interfere.
Furthermore, as this project is in its early stage, issues may currently prevent it from scaling.
2024-04-13 10:13:29 +02:00
2024-04-17 15:20:58 +02:00
# Once you have it running
2024-04-13 10:13:29 +02:00
2024-04-17 15:20:58 +02:00
It can be opaque to get started with all this. To make it
easier for others, please consider contributing back your configurations to
us.
2024-04-13 10:13:29 +02:00
2024-04-17 15:20:58 +02:00
# Contributing
If you have any ideas, enhancements, bug reports or general questions, please don't hesitate to [create a new issue](https://gitlab.com/adoralaura/ntppool-exporter/-/issues/new).
2024-04-13 10:13:29 +02:00
2024-04-17 15:20:58 +02:00
If you want to contribute to this project, please read the [Contribution Guidelines](CONTRIBUTING.md)