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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for iptables_exporter-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a620ddf6d91c6fa9f3c0d13632a0f19d47538d5324d138f51efa1c43b6d3bbfa |
|
MD5 | 61051e3a842e1d5db34f7d45faf48655 |
|
BLAKE2b-256 | 1efff41aacb596e93dc5d58140d972c722c959d5728ae113d5c98e75b2eb4361 |