Skip to main content

Prometheus iptables exporter

Project description

iptables-exporter collects traffic data from iptables rules.

Installation

pip install iptables-exporter

Usage

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 10.0.0.0/8     --dport ssh -j ACCEPT -m comment --comment "iptables-exporter ssh traffic"
iptables -A INPUT -s 172.16.0.0/12  --dport ssh -j ACCEPT -m comment --comment "iptables-exporter ssh traffic"
iptables -A INPUT -s 192.168.0.0/16 --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 details)

Uploaded Source

Built Distribution

iptables_exporter-0.3.1-py2.py3-none-any.whl (5.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file iptables-exporter-0.3.1.tar.gz.

File metadata

File hashes

Hashes for iptables-exporter-0.3.1.tar.gz
Algorithm Hash digest
SHA256 4da994bb3be5fa07bbd358bd3a4622eb27bc135085d3591e6c3315f9e8a09542
MD5 a1c37a23a63ff0f2a3257c84a704510d
BLAKE2b-256 2a7e71347acaaa0792788ff475b76daeda013f717dbfdcfa7375f01081daef98

See more details on using hashes here.

File details

Details for the file iptables_exporter-0.3.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for iptables_exporter-0.3.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6fb00ce94f1cf9ced8a62e09415870a7b78845a429be5905144aec168fe30996
MD5 e7fb3e9cc9003474b1ad4bd4c496044c
BLAKE2b-256 9cf2de27cca118250eb40c18437de23fc2ccf6f7adf2618073d4389e863838d5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page