Skip to main content

Prometheus iptables exporter

Project description

iptables-exporter collects traffic data from iptables rules.


pip install iptables-exporter


Test run:

iptables-exporter --dump-data

Run iptables-exporter:

iptables-exporter --port 9119

Point your browser to http://localhost:9119/metrics

Configure iptables

Just add a comment starting with iptables-exporter to your iptables rule:

iptables -A INPUT --dport ssh -j ACCEPT -m comment --comment "iptables-exporter ssh traffic"

collects packets and bytes counter:

iptables_packets{table="filter",chain="input",rule="ssh traffic"} 347.0
iptables_bytes{table="filter",chain="input",rule="ssh traffic"} 44512.0

More rules with same name:

iptables -A INPUT -s     --dport ssh -j ACCEPT -m comment --comment "iptables-exporter ssh traffic"
iptables -A INPUT -s  --dport ssh -j ACCEPT -m comment --comment "iptables-exporter ssh traffic"
iptables -A INPUT -s --dport ssh -j ACCEPT -m comment --comment "iptables-exporter ssh traffic"

exports only the total of the 3 rules as they have same table, chain and name.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iptables-exporter-0.3.1.tar.gz (3.4 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page