Skip to main content

woninet

A local network monitoring system.

woninet continuously monitors devices on a local network using ARP and ICMP probes. It enumerates candidate IP addresses in a /24 subnet, determines device availability, measures latency and packet loss, stores metrics in SQLite, and evaluates configurable alert rules in real time.

Note: This script requires sudo privileges.

Features

  • ARP + ICMP Host Detection (Distinguishes real devices from nonexistent IPs and filters out Wi‑Fi ARP‑delay noise.)

  • Alert Engine (Evaluates real‑time alert rules (e.g., latency thresholds))

  • Threaded Collectors

  • SQLite database (for devices, recorded metrics, alert states, and alert events.)

  • Positional Argument for easier access to the database from the CLI

  • Detailed Logging

Future Plans

  • Add ARP table caching to further reduce Wi‑Fi latency noise.
  • Accept MAC addresses as command‑line arguments.
  • Fetch MAC address from database for offline devices.
  • Use ARP noise limit as device state for styling in front-end.
  • Add CLI argument to accept target IP addresses from a file.

Known Issues

  • Monitoring Scope Limited to /24 Subnet

How To Run

Note: woninet is under active development.

Installation from PyPI

Unix/Linux

Create and activate a virtual environment:

python3 -m venv --copies venv
source venv/bin/activate

Install woninet from PyPI:

pip install woninet

Grant the required capability to the Python interpreter:

sudo setcap cap_net_raw=eip venv/bin/python3

Then run:

woninet --help

macOS/Windows

Install from PyPI:

pip install woninet

Then run:

woninet --help

Installation from Source

1. Clone the repository

git clone https://github.com/teymuri-alireza/woninet
cd woninet

2. Create and activate a virtual environment:

Note: Create the virtual environment outside the project directory to avoid Multiple top-level packages discovered in a flat-layout errors.

Unix/Linux note: The --copies flag forces Python to copy the interpreter instead of using a symbolic link. This is required because you will apply Linux capabilities directly to the Python binary in the virtual environment.

Linux/macOS

python3 -m venv --copies ../venv
source ../venv/bin/activate

Windows (PowerShell)

py -m venv ..\venv
..\venv\Scripts\Activate.ps1

3. Install woninet locally:

pip3 install .

4. Run woninet

Unix/Linux only: To allow raw ICMP without running as root, grant the required capability to the Python interpreter inside the virtual environment:

sudo setcap cap_net_raw=eip ../venv/bin/python3

Finally, run woninet normally:

woninet --version

Alternative (not recommended): You can run woninet with sudo instead of using setcap, but this is discouraged for security reasons:

sudo ../venv/bin/python3 -m woninet

Configuration

You can define alert rules in a JSON file. Rename the example file at woninet/config.example.json to config.json. The application will load the alert rules from that file at startup.

Example:

{
    "monitoring": {
        "arp_noise_limit": 300.0,
        "max_workers": 4
    },
    "database": "woninet.db",
    "target_ip_list": [
        "192.168.1.1-100"
        // or
        "192.168.1.1", "192.168.1.10", "192.168.1.20"
    ],
    "alert_rules":[
        {
            "metric": "latency",
            "threshold": 100,
            "consecutive_checks": 3
        },
        {
            "metric": "packet_loss",
            "threshold": 0.0,
            "consecutive_checks": 1
        }
    ]
}

Explanations:

Monitoring Settings

  • arp_noise_limit: Latency threshold in milliseconds used to filter ARP resolution noise. Set to 0 to disable filtering. Helps eliminate Wi‑Fi latency spikes.
  • max_workers: Maximum number of thread workers used to send ICMP pings. Higher values may increase system load and latency.

Database

  • database: The path to the SQLite database file where metrics and alerts are stored.

Target IP List

  • A single or range of target IP addresses to scan.

Alert Rules

  • metric: The metric name to evaluate (latency or packet_loss)
  • threshold: The value that triggers the alert. For latency, this is in milliseconds. For packet loss, this is a percentage (0.0-100.0).
  • consecutive_checks: The number of consecutive evaluations required before the alert state changes. Higher values reduce false positives.

Notes

  • Packet Loss: Values are in the range [0.0, 100.0]. A value of 100.0 indicates 100% packet loss. A value of 0.0 will trigger on any packet loss.
  • Latency: All latency thresholds are evaluated in milliseconds.

Usage

This guide explains common ways to run woninet and how to resolve common issues.

Testing

If you want to run the test suite locally, install the optional test dependencies:

pip install -e ".[test]"

Then run:

pytest

The test suite currently focuses on API behavior and core logic, and it uses pytest for automated verification.

Requirements

  • Python >= 3.12
  • Root privileges

Documentation

if you have any question or need clarification, check the documentation guide.

Contribution

Thanks for considering contributing to woninet! To help us maintain code quality, stability, and a predictable release process, please review and follow the guidelines in our Contributing Guide.

Metadata

Release files for woninet 2.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for woninet 2.0.3
File Size Uploaded
woninet-2.0.3.tar.gz 477.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for woninet 2.0.3
File Interpreter ABI Platform
woninet-2.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 966.3 kB

Release files / woninet-2.0.3.tar.gz

Download URL woninet-2.0.3.tar.gz
Size 477.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e65a41bf71f4409775e1ef44fce975c6ab8feb8e650c766662c716fc810032a5
BLAKE2b-256 checksum
How to use checksums
5f60294a5737251958355d5ca7116d578b27344f8b56775d612b6ddc1523ca23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / woninet-2.0.3-py3-none-any.whl

Download URL woninet-2.0.3-py3-none-any.whl
Size 488.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
200a5c15527d6841956e7015d0b0e9c18f2862073f0a344d9f63143327860b6b
BLAKE2b-256 checksum
How to use checksums
7b22c3ff5b00ea7b84016a3be61c745cb0fb4ef3cb3cba94c40e0d3dfa34eb1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

2.1.0

2 release files

This release

2.0.3 This release

2 release files

2.0.2

2 release files

2.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page