Skip to main content

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.

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.9.3.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iptables_exporter-0.9.3-py2.py3-none-any.whl (4.0 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: iptables-exporter-0.9.3.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for iptables-exporter-0.9.3.tar.gz
Algorithm Hash digest
SHA256 dfa263c0c7a554331f8de7f87b8c657bf2e6f919141503d8f43b9c1690a8a74b
MD5 8c870c9b6bcc7c49caaa9636d18f8c33
BLAKE2b-256 3482cfd5d4a145accf7453277dc0e64d38720a808443a86151b823357a56cccf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: iptables_exporter-0.9.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using 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

File hashes

Hashes for iptables_exporter-0.9.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 23c83bb8eee45ed07b0d740a71c84d3e0517066f9ba33048dc736b8a6da6f05e
MD5 552715182cdb4c6c0b20dc6e0513c7fb
BLAKE2b-256 caebd0ac436519e9a7b27d1a2da63f44428f9b0063c43c299f14f30a60df4127

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.9.3 This release

2 files

0.9.2

1 file

0.9.0

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

0.1.4

2 files

0.1.3

2 files

Supported by

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