Skip to main content

Prometheus iptables exporter

Project description

# 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

Otionally you can monitor specific rules by adding a comment starting with iptables-exporter to your rule:

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 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.9.0.tar.gz (3.4 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.0-py2.py3-none-any.whl (5.5 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: iptables-exporter-0.9.0.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.8.1

File hashes

Hashes for iptables-exporter-0.9.0.tar.gz
Algorithm Hash digest
SHA256 b6cd3faf972ccc5956bde6968ecec250316f0e1078c6d127fa054d807c2d68d0
MD5 67979761d60e871e2a184ba3bf3bda17
BLAKE2b-256 247a98afbc8a7eb57621a10070feb91028a2ab7139940d9e09f0f59e9daf75ec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for iptables_exporter-0.9.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 1d7dc8c96ab8e0c862af20c483462e202f877ac79246aec687aa66ebd5d3a13e
MD5 c883e488179b56e19561452f82e43c7a
BLAKE2b-256 bb8491565e56ddb7d2cfbb25b078f31040e124b9722776baaf9764ce043752fb

See more details on using hashes here.

Supported by

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