Go to file
Ilgiz Kalmetyev 83aa11392a добавлена команда monitor ingest 2026-03-30 10:00:46 +05:00
docs добавлена команда monitor ingest 2026-03-30 10:00:46 +05:00
ops добавлена настройка конкретного сетевого интерфейса, для которого собираются события 2026-03-29 21:17:19 +05:00
plan plan bootstrap 2026-03-29 11:35:52 +05:00
registries удалена валидация для d-bus и journal 2026-03-30 09:15:35 +05:00
scripts common commit 2026-03-29 19:19:12 +05:00
src/wifi_agentd добавлена команда monitor ingest 2026-03-30 10:00:46 +05:00
tests добавлена команда monitor ingest 2026-03-30 10:00:46 +05:00
.gitignore common commit 2026-03-29 19:19:12 +05:00
README.md добавлена команда monitor ingest 2026-03-30 10:00:46 +05:00
pyproject.toml common commit 2026-03-29 19:19:12 +05:00

README.md

Wi-Fi Linux Agent

Wi-Fi Linux Agent is a systemd-managed Python daemon for collecting Wi-Fi configuration parameters, statuses, and events from a Linux host, normalizing them under contract-driven rules, storing them in an intermediate cache, and dispatching them to external collectors.

What the agent does

The agent collects data from these source families:

  • configuration files;
  • wpa_supplicant D-Bus;
  • systemd journal (wpa_supplicant and other configured processes).

It classifies collected data into three canonical families:

  • configuration snapshots;
  • status snapshots;
  • event notifications.

After collection the agent:

  1. normalizes source payloads into canonical records;
  2. validates them against per-source data contracts;
  3. stores validated records in an intermediate cache with TTL;
  4. assigns each record to a delivery queue;
  5. sends queued records to either webhook targets or zabbix_sender.

Core capabilities

  • source registry with connection, heartbeat, and enable/disable parameters;
  • data registry with collection mode, TTL, queue selection, collect/skip behavior, and validation rules;
  • immediate queue and four batch queues with different dispatch intervals;
  • systemd daemon runtime;
  • CLI utility for O&M tasks:
    • inspect agent state;
    • inspect sources;
    • inspect queues;
    • reset queue counters;
    • inspect cache;
    • purge cache;
    • tail normalized events.
    • monitor live source, cache, and queue streams.
    • replay source records into cache with monitor ingest.
    • filter monitor streams by source and queue for loss analysis.
  • Linux smoke-run helper for validating the journal and D-Bus paths from a checkout or an installed environment.
  • shared deployment environment file at /etc/wifi-agentd/.env for both daemon and CLI.

Current implementation assumptions

  • Python version: >= 3.12.4
  • v1 persistence: SQLite
  • v1 runtime mode: single-host daemon under systemd
  • operator-facing runtime configuration is loaded from /etc/wifi-agentd/.env
  • Wi-Fi event filtering uses WIFI_AGENT_WIFI_INTERFACE from the shared .env
  • D-Bus integration is backed by dbus-next and degrades gracefully if the bus or import is unavailable
  • journal event collection uses journalctl when available
  • checkout-local smoke helper: scripts/smoke_linux.py

Main concepts

Source registry

Defines the technical description of each source:

  • source id;
  • source type;
  • connection parameters;
  • heartbeat / keepalive settings;
  • enabled / disabled flag.

Data registry

Defines what data is collected and how it is handled:

  • contract id;
  • source binding;
  • record family;
  • collection mode (push / poll);
  • TTL in cache;
  • queue mode and queue name;
  • target type;
  • collect / skip behavior;
  • validation rules.

Queues

Two queue classes are supported:

  • immediate dispatch;
  • batched dispatch.

The default queue set is:

  • q.immediate
  • q.batch.15s
  • q.batch.60s
  • q.batch.300s
  • q.batch.900s

Each queue is bound to one delivery target configuration.

Repository layout

wifi-agentd/
  README.md
  pyproject.toml
  docs/
    deployment.md
    usage.md
  ops/
    env/
    systemd/
    dbus/
  src/wifi_agentd/
  registries/
  tests/
  scripts/

Documentation

  • Deployment guide: docs/deployment.md
  • Usage and O&M guide: docs/usage.md
  • Planning and Codex prompt-pack: plan/wifi_agentd_plan_prompt_pack.md

Delivery scope of v1

Included:

  • config file collection;
  • WPA D-Bus status/event adapter backed by dbus-next;
  • journal event adapter backed by journalctl;
  • cached delivery to webhook and zabbix_sender;
  • persistent queue delivery counters for delivered, dropped, and expired;
  • CLI and systemd service integration.

Not included in the first functional increment:

  • clustering;
  • external message broker;
  • GUI;
  • active remediation;
  • autonomous ML/LLM behavior;
  • full D-Bus configuration collection implementation beyond the stub.

Current status

The repository now contains a runnable baseline with:

  • typed settings loading;
  • registry loading and validation;
  • SQLite-backed cache and queue tables;
  • persistent queue delivery counters and reset support;
  • config-file collection;
  • D-Bus status/event collection backed by dbus-next;
  • journal event collection via journalctl;
  • webhook and zabbix_sender delivery adapters;
  • Typer-based CLI;
  • systemd unit file.