Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

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

Release history Release notifications

This version
History Node


History Node


History Node


History Node


History Node


History Node


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
iptables_exporter-0.3.2-py2.py3-none-any.whl (5.2 kB) Copy SHA256 hash SHA256 Wheel 2.7 Dec 14, 2016
iptables-exporter-0.3.2.tar.gz (3.4 kB) Copy SHA256 hash SHA256 Source None Dec 14, 2016

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page