A lightweight, open-source network monitoring utility that periodically probes external endpoints using curl, captures comprehensive timing metrics, and stores results in PostgreSQL for analysis and visualization in Grafana.
watchmynetwork (wmn) provides real-time network monitoring with sub-second granularity. It probes popular and reliable endpoints at 1-second intervals, capturing detailed performance metrics and storing them in a PostgreSQL database for historical analysis and SLA reporting.
- High-frequency probing – Fixed 1-second cadence for precise monitoring
- Comprehensive metrics – DNS, TCP, TLS, TTFB, and total response times via curl (native libcurl)
- Multi-endpoint support – Monitor multiple sources simultaneously per probe cycle
- Time-series storage – Direct PostgreSQL integration for efficient data persistence
- Production-ready – Runs as a systemd service with automatic startup
- Grafana integration – Pre-configured dashboards for visualization and alerting
- Minimal footprint – Lightweight Rust binary with few dependencies
systemd
│
└─► wmn (Rust binary)
│
├─► Scheduler (1 Hz, strict timing)
├─► Fire-and-forget probe tasks
└─► curl subprocess (no keep-alive, enforced timeouts)
│
└─► PostgreSQL (time-series storage)
│
└─► Grafana (dashboards & SLA reports)
- Probe Groups: Each scheduler tick generates a unique
probe_id - Multi-source Monitoring: One row is recorded per
(probe_id, source)combination - Downtime Detection: A probe is marked DOWN when all sources fail for the same
probe_id - SLA Metrics: Uptime, downtime events, and packet loss are computed from probe group aggregations
Each probe collects the following data points:
| Metric | Description |
|---|---|
ts |
Timestamp of the probe |
source |
Target endpoint URL |
probe_id |
Unique identifier for the probe cycle |
dns_ms |
DNS resolution time (milliseconds) |
connect_ms |
TCP connection establishment time |
tls_ms |
TLS/SSL handshake time |
ttfb_ms |
Time to first byte |
total_ms |
Total request duration |
status |
HTTP status code returned |
disconnected |
Boolean flag indicating connection failure |
- Docker and Docker Compose
- Linux system with systemd support
curlinstalled on the host
git clone https://github.com/vonnue/watchmynetwork.git
cd watchmynetworkLaunch the backing services using Docker Compose:
docker compose up -dThis initializes:
- PostgreSQL on
localhost:5432with the time-series schema pre-configured - Grafana on
localhost:3000with datasource already connected
Run the installation script with sudo privileges:
sudo ./install_wmn.shThis will:
- Install the
wmnbinary to/usr/local/bin/ - Create and configure
wmn-agent.service - Enable the service for automatic startup on boot
- Start monitoring immediately
Open your browser and navigate to:
http://localhost:3000
First-time setup:
- Set your admin password when prompted
- Verify the PostgreSQL datasource connection (pre-configured)
- Import the included dashboard or create your own
Import the example dashboard for instant visualization:
- In Grafana, go to Dashboards → Import
- Upload
grafana/dashboard-favicon.jsonfrom the repository
The monitoring data is stored in the favicon_metrics table:
CREATE TABLE favicon_metrics (
ts TIMESTAMPTZ NOT NULL DEFAULT now(),
probe_id BIGINT NOT NULL,
source TEXT NOT NULL,
dns_ms DOUBLE PRECISION,
connect_ms DOUBLE PRECISION,
tls_ms DOUBLE PRECISION,
ttfb_ms DOUBLE PRECISION,
total_ms DOUBLE PRECISION,
status INTEGER,
disconnected BOOLEAN NOT NULL,
PRIMARY KEY (probe_id, source)
);
CREATE INDEX ON favicon_metrics (ts);
CREATE INDEX ON favicon_metrics (source, ts);- Redirects: Enabled by default (configurable option coming soon)
- Connection pooling: Disabled (no keep-alive)
- Probe interval: Fixed at 1 second
- Timeout enforcement: Handled by curl subprocess (1.5 seconds)
Monitor real-time logs from the wmn agent:
journalctl -u wmn-agent -f# Check service status
sudo systemctl status wmn-agent
# Stop the service
sudo systemctl stop wmn-agent
# Restart the service
sudo systemctl restart wmn-agent
# Disable auto-start
sudo systemctl disable wmn-agentContributions are welcome! We appreciate:
- Performance optimizations
- New feature implementations
- Enhanced Grafana dashboards
- Bug fixes and issue reports
- Documentation improvements
To contribute:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Configuration support
- Support for additional protocols (ICMP, UDP)
- Alerting capabilities
- Prometheus exporter option
This project is licensed under the MIT License - see the LICENSE file for details.
You are free to use, modify, and distribute this project for any purpose.
- Issues: GitHub Issues
- Discussions: GitHub Discussions