Iptables exporter
A Prometheus exporter that 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
Docker
docker run --net=host --cap-add=NET_ADMIN madron/iptables-exporter
Configure iptables
Optionally you can monitor specific rules by adding a comment starting with iptables-exporter:
iptables -A INPUT --dport ssh -j ACCEPT -m comment --comment "iptables-exporter ssh traffic"
collects packets and bytes counter:
iptables_packets{ip_version="4",table="filter",chain="input",rule="ssh traffic"} 347.0
iptables_bytes{ip_version="4",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 total packets and bytes for the 3 rules as they have same ip_version, table, chain and name.
Metadata
Release files for iptables-exporter 0.9.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| iptables-exporter-0.9.3.tar.gz | 3.6 kB | Without provenance | Details for iptables-exporter-0.9.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| iptables_exporter-0.9.3-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for iptables_exporter-0.9.3-py2.py3-none-any.whl |
Total release size: 7.6 kB
Release files / iptables-exporter-0.9.3.tar.gz
| Download URL | iptables-exporter-0.9.3.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dfa263c0c7a554331f8de7f87b8c657bf2e6f919141503d8f43b9c1690a8a74b
|
|
BLAKE2b-256 checksum How to use checksums |
3482cfd5d4a145accf7453277dc0e64d38720a808443a86151b823357a56cccf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.9.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.10
|
Release files / iptables_exporter-0.9.3-py2.py3-none-any.whl
| Download URL | iptables_exporter-0.9.3-py2.py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
23c83bb8eee45ed07b0d740a71c84d3e0517066f9ba33048dc736b8a6da6f05e
|
|
BLAKE2b-256 checksum How to use checksums |
caebd0ac436519e9a7b27d1a2da63f44428f9b0063c43c299f14f30a60df4127
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.9.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.10
|
Security for iptables-exporter 0.9.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.