Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

netmon

A lightweight host/agent network monitor that measures local gateway and internet latency, stores history in SQLite, and serves a browser dashboard.

How it works

  • The host runs on your main machine — it monitors itself, listens for agent uploads on port 8765, and serves a live browser dashboard.
  • An agent runs on a remote machine (e.g. a Raspberry Pi) — it measures that machine's network latency, buffers samples locally, and syncs to the host even if the host was temporarily offline.

Build

cd netmon
cargo build --release

Binary: target/release/netmon (or netmon.exe on Windows)

Usage

Run the host

netmon host

Defaults to binding 0.0.0.0:8765 and storing data in netmon-host.db. Dashboard: http://HOST_IP:8765

Custom bind address or database path:

netmon host --bind 0.0.0.0:9000 --db /data/netmon.db

Run an agent

netmon agent --host http://192.168.1.50:8765

Optional custom name (defaults to the machine's hostname):

netmon agent --host http://192.168.1.50:8765 --name bedroom-pi

Eventual consistency

Agents never lose samples if the host is temporarily offline:

  1. Agent records a sample locally in SQLite.
  2. Agent sends batches to the host /ingest endpoint.
  3. Host acknowledges the highest sequence number it received.
  4. Agent deletes only acknowledged rows.

When the host comes back online, agents automatically backfill all missing data.

Thresholds

Metric Warn Critical
Local latency 5 ms 10 ms
Internet latency 25 ms 45 ms

API

Endpoint Method Description
/ GET Browser dashboard
/api/nodes GET List all monitored nodes
/api/history/:node GET 1-hour latency history for a node
/ingest POST Agent data upload endpoint

Files created

  • Host: netmon-host.db
  • Agent: netmon-agent.db

Stop

Press Ctrl+C. Safe to restart at any time — agents resume from their local queue.