Network speed monitor
495
A Flask-based application for testing both LAN and WAN network speeds with Telegram notifications.
123456789:ABCdefGHIjklMNOpqrsTUVwxyz)/startdocker run -d \
--name netspeed \
-p 8080:8080 \
-v /path/to/data:/data \
-e TELEGRAM_BOT_TOKEN="your_bot_token_here" \
-e TELEGRAM_CHAT_ID="your_chat_id_here" \
-e PAGE_URL="http://your-server-ip:8080" \
-e WAN_SCHEDULE_CRON="*/30 * * * *" \
netspeed:latest
Before running the main app, test your Telegram setup:
# Set environment variables
export TELEGRAM_BOT_TOKEN="your_bot_token_here"
export TELEGRAM_CHAT_ID="your_chat_id_here"
# Run test script
python test_telegram.py
| Variable | Default | Description |
|---|---|---|
TELEGRAM_BOT_TOKEN | (required) | Your Telegram bot token from @BotFather |
TELEGRAM_CHAT_ID | (required) | Your Telegram chat ID |
TELEGRAM_TOPIC_ID | "" | Forum topic ID for organized discussions (optional) |
PAGE_URL | "" | Public URL for the app (used in Telegram links) |
WEB_URL | "http://localhost:8080" | Web interface URL for Telegram messages |
WAN_SCHEDULE_CRON | "*/30 * * * *" | Cron schedule for automatic WAN tests ("off" to disable) |
DB_PATH | "/data/netspeed.sqlite" | SQLite database path |
PORT | 8080 | HTTP port to listen on |
ALERT_THRESHOLD_PCT | 5.0 | Percentage change threshold for alerts |
POST /api/run-wan - Run WAN speed testPOST /api/run-all - Run LAN tests + WAN testPOST /api/report - Report custom test resultsGET /api/results - Get test historyGET /api/averages - Get 3-day averages and changesGET /api/wan-status - Get WAN test status with percentage changesGET /api/cron/status - Get current cron job status and configurationPOST /api/cron/update - Update cron schedule (frequency or custom)POST /api/cron/disable - Disable cron jobGET /api/debug/telegram - Check Telegram configurationPOST /api/debug/test-telegram - Send test messageGET /events - Server-Sent Events streamThe app includes a user-friendly web interface for managing automated WAN speed tests:
The app uses standard cron format: minute hour day month weekday
*/15 * * * * = Every 15 minutes0 * * * * = Every hour at minute 00 0 * * * = Daily at midnight/api/debug/telegram to verify settingspython test_telegram.py to test your setupapi.telegram.org/start to your bot in Telegram# Install dependencies
pip install flask sqlalchemy requests speedtest-cli
# Set environment variables
export TELEGRAM_BOT_TOKEN="your_token"
export TELEGRAM_CHAT_ID="your_chat_id"
# Run app
python app.py
docker build -t netspeed .
MIT License
Content type
Image
Digest
sha256:89e7aef29…
Size
62.6 MB
Last updated
about 1 year ago
docker pull joramas/lan-wan-speedtest