hatamiarash7/ipset-exporter

By hatamiarash7

Updated about 2 months ago

Export ipset data as Prometheus metric

Image
Monitoring & Observability

61

Prometheus Exporter for ipset

GolangReleaseLicenseImage size

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

How-to

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 \
    -p 4613:4613 \
    -v /path/to/config.yml:/app/configs/config.yml \
    -e CONFIG_FILE=/app/configs/config.yml \
    --cap-add=NET_ADMIN \
    hatamiarash7/ipset-exporter:latest

Configuration

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.


Support 💛

Donate with BitcoinDonate with Ethereum

Contributing 🤝

Don't be shy and reach out to us if you want to contribute 😉

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request

Issues

Each project may have many problems. Contributing to the better development of this project by reporting them. 👍

Docker Pull Command

docker pull hatamiarash7/ipset-exporter