It's a simple ipset exporter that generate Prometheus metrics from ipset lists. Every metric has a label set
that shows the ipset list name with the number of elements in the list as the value.
ipset_count{set="my-set-1"} 41
ipset_count{set="my-set-2"} 23
This exporter needs NET_ADMIN
to fetch ipset data using netlink. You can build and run this exporter as a single binary:
make
sudo setcap cap_net_admin+ep ./bin/ipset-exporter
cp config.yml.example
./bin/ipset-exporter
Or you can use Docker:
docker run -d \
--name ipset-exporter \
--net host \
-v /path/to/config.yml:/app/configs/config.yml \
-e CONFIG_FILE=/app/configs/config.yml \
--cap-add=NET_ADMIN \
hatamiarash7/ipset-exporter:latest
Note
The Docker container needs to run with NET_ADMIN
capability to fetch ipset data.
Also, You should run it with --net host
to access the host network namespace.
You can configure the exporter using a YAML file. The example configuration is:
app:
host: 127.0.0.1
port: 4613
log_level: info
ipset:
names:
- my-set-1
- my-set-2
You can choose any ipset name that you want to monitor or use the all
keyword to monitor all ipset lists.
Don't be shy and reach out to us if you want to contribute 😉
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request
Each project may have many problems. Contributing to the better development of this project by reporting them. 👍