Skip to content

nexuspcs/ConnectivityMonitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

35 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Connectivity Monitor

A real-time network monitoring tool that tracks latency, detects outages, and gives you the data to prove your ISP is dropping the ball. Available for Windows (PowerShell), macOS (Bash), and Linux / Raspberry Pi (Python).

Built out of frustration with flaky ISPs and mysterious Wi-Fi drops. If you've ever wanted to prove to your ISP that yes, the connection is dropping, this tool gives you the data to back it up.

KEY EXPORTS

  • Export to CSV β€” daily-rotating logs for ping results, drops, and latency breaches
  • HTML Dashboard export β€” Chart.js-powered reports with dark theme
  • Live Web Dashboard β€” auto-refreshing browser dashboard with 5 tabs (Python version)

What It Does

Connectivity Monitor continuously pings targets (Cloudflare, Google DNS, OpenDNS by default), tracks latency and packet loss, detects outages, and logs everything to CSV. When it detects problems, it tells you what's wrong: whether it's your gateway, your ISP, DNS, or the target itself.

Key Features

  • Live dashboard with 5 tabs β€” overview, latency graph, drop log, per-target stats, and a heatmap
  • Smart diagnostics β€” automatically figures out where the problem is (local network, gateway, ISP, DNS)
  • Health scoring β€” grades your connection from A+ to F based on latency, jitter, and packet loss
  • Baseline learning β€” learns your normal latency from the first 30 pings, then flags deviations
  • Traceroute on drops β€” kicks off a background traceroute when connectivity drops so you can see where packets are dying
  • HTML reports β€” auto-generated every 500 pings and on exit, with Chart.js charts and stats
  • CSV logging with daily rotation β€” ping results, drops, and latency threshold breaches all in separate files
  • Wi-Fi signal tracking β€” monitors signal strength over time if you're on wireless
  • Built-in web server β€” live auto-refreshing dashboard accessible from any browser on your network (Python version)

image image

Platform Support

Platform Version Directory Details
Windows PowerShell terminal dashboard windows/ Windows README
macOS Bash terminal dashboard macos/ macOS README
Linux / Raspberry Pi Python web dashboard python/ Python README

Each platform directory contains a self-contained implementation with its own documentation. See the platform-specific READMEs for detailed setup instructions.


Quick Start

Windows (PowerShell)

Requirements: Windows 10/11, PowerShell 5.0+

git clone https://github.com/nexuspcs/ConnectivityMonitor.git
cd ConnectivityMonitor\windows
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
.\ConnectivityDropMonitor.ps1

Follow the setup prompts β€” pick your network adapter, set your ping targets, and you're live. The tabbed terminal dashboard starts immediately.

πŸ“– Full details: windows/README.md

macOS (Bash)

Requirements: macOS, Bash 3.2+, python3

git clone https://github.com/nexuspcs/ConnectivityMonitor.git
cd ConnectivityMonitor/macos
chmod +x ConnectivityDropMonitor.sh
./ConnectivityDropMonitor.sh

πŸ“– Full details: macos/README.md

Linux / Raspberry Pi (Python)

Requirements: Python 3.6+ (no external dependencies β€” stdlib only)

git clone https://github.com/nexuspcs/ConnectivityMonitor.git
cd ConnectivityMonitor/python
python3 -m connectivity_monitor

Follow the interactive prompts, then open http://localhost:8080 in your browser for the live dashboard.

Headless mode (servers, Raspberry Pi, etc.)

# Run with defaults or saved config, no prompts
python3 -m connectivity_monitor --headless

# Customize from command line
python3 -m connectivity_monitor --headless --targets 1.1.1.1,8.8.8.8 --web-port 9090 --poll 5

Then access the live dashboard from any device on your network at http://<device-ip>:8080.

Run on boot with systemd

# Copy the service file
sudo cp python/connectivity-monitor@.service /etc/systemd/system/

# Enable and start (replace YOUR_USER with your username)
sudo systemctl enable connectivity-monitor@YOUR_USER
sudo systemctl start connectivity-monitor@YOUR_USER

# Check status
sudo systemctl status connectivity-monitor@YOUR_USER

πŸ“– Full details: python/README.md


Setup & Configuration

On first run, you'll be prompted to configure:

Setting Default What it does
Poll interval 2 seconds How often to ping
Failure threshold 4 consecutive failures How many missed pings before a "drop" is recorded
Ping targets 1.1.1.1, 8.8.8.8, 208.67.222.222 What to ping β€” Cloudflare, Google, OpenDNS
Latency warning 100ms Threshold for flagging high latency
DNS health check Yes Also check DNS resolution each cycle
DNS hostname google.com What hostname to resolve for DNS checks
Web dashboard port 8080 Port for the live web dashboard (Python version)

Config is saved to ~/ConnectivityMonitor/monitor_config.json (or %USERPROFILE%\ConnectivityMonitor\ on Windows) and reused on next run.

πŸ“– Full configuration guide: docs/CONFIGURATION.md


Dashboard Tabs

All versions have 5 tabs with the same information:

Tab Content
Overview Health score, uptime, latency stats, diagnostics, latency chart, and histogram
Graph Full-width latency-over-time chart with gateway overlay
Drops Log of all connectivity drop events with timestamps, duration, and diagnosis
Targets Per-target breakdown showing loss, avg, min, max for each ping target
Heatmap 24-hour heatmap of average latency β€” spot time-of-day patterns

PowerShell / macOS versions: Switch tabs with 1–5 keys. Press P to pause, R to reset, E to export, Q to quit.

Python version: Click tabs in the web dashboard. Auto-refreshes every 3 seconds.


Web Dashboard & API (Python version)

The Python version includes a built-in HTTP server that serves:

Endpoint Description
/ or /dashboard Live auto-refreshing dashboard with all 5 tabs
/reports/ List of generated HTML reports
/logs/ List of CSV log files
/api/status JSON: health score, uptime, loss, latency stats, trend
/api/history JSON: recent ping and gateway latency history
/api/drops JSON: connection drop events
/api/targets JSON: per-target statistics
/api/heatmap JSON: hourly latency averages

Access from any device on your network: http://<device-ip>:8080

πŸ“– Full API reference: docs/API.md


Output Files

Everything gets saved under ~/ConnectivityMonitor/ (or %USERPROFILE%\ConnectivityMonitor\ on Windows):

ConnectivityMonitor/
β”œβ”€β”€ logs/
β”‚   β”œβ”€β”€ ping_log_2025-01-15.csv        # Every ping result with 18 columns
β”‚   β”œβ”€β”€ drops_2025-01-15.csv           # Connectivity drop events
β”‚   └── breaches_2025-01-15.csv        # Latency threshold breaches
β”œβ”€β”€ reports/
β”‚   └── report_2025-01-15_143022.html  # HTML report with Chart.js charts
└── monitor_config.json                # Your saved config

Logs rotate daily. HTML reports are generated automatically every 500 pings and on exit.


What the Health Score Means

Grade Score What it means
A+ 90-100 Solid connection β€” low latency, minimal jitter, no drops
A 80-89 Great connection with very minor variations
B 70-79 Fine for most things, minor latency spikes
C 60-69 Noticeable issues β€” you'll feel it in video calls and gaming
D 50-59 Rough β€” frequent spikes or packet loss
F 0-49 Broken β€” significant packet loss or sustained high latency

Repository Structure

ConnectivityMonitor/
β”œβ”€β”€ windows/                              # Windows PowerShell version
β”‚   β”œβ”€β”€ ConnectivityDropMonitor.ps1       #   Main script (2132 lines)
β”‚   └── README.md                         #   Windows-specific documentation
β”œβ”€β”€ macos/                                # macOS Bash version
β”‚   β”œβ”€β”€ ConnectivityDropMonitor.sh        #   Main entry point
β”‚   β”œβ”€β”€ lib/                              #   Modular library files
β”‚   β”‚   β”œβ”€β”€ state.sh                      #     Global state variables
β”‚   β”‚   β”œβ”€β”€ config.sh                     #     Configuration management
β”‚   β”‚   β”œβ”€β”€ network.sh                    #     Ping, DNS, gateway, traceroute
β”‚   β”‚   β”œβ”€β”€ metrics.sh                    #     Statistics and health scoring
β”‚   β”‚   β”œβ”€β”€ display.sh                    #     Graph and display builders
β”‚   β”‚   β”œβ”€β”€ tabs.sh                       #     Tab bar and view builders
β”‚   β”‚   └── logging.sh                    #     CSV logging and HTML reports
β”‚   └── README.md                         #   macOS-specific documentation
β”œβ”€β”€ python/                               # Cross-platform Python version
β”‚   β”œβ”€β”€ connectivity_monitor/             #   Main package
β”‚   β”‚   β”œβ”€β”€ __init__.py                   #     Package metadata
β”‚   β”‚   β”œβ”€β”€ __main__.py                   #     CLI entry point
β”‚   β”‚   β”œβ”€β”€ config.py                     #     Configuration management
β”‚   β”‚   β”œβ”€β”€ state.py                      #     Global monitor state
β”‚   β”‚   β”œβ”€β”€ network.py                    #     Ping, DNS, gateway, traceroute
β”‚   β”‚   β”œβ”€β”€ metrics.py                    #     Statistics and health scoring
β”‚   β”‚   β”œβ”€β”€ csv_logger.py                 #     CSV logging with daily rotation
β”‚   β”‚   β”œβ”€β”€ html_report.py                #     HTML report generation
β”‚   β”‚   β”œβ”€β”€ web_server.py                 #     Built-in HTTP server + dashboard
β”‚   β”‚   └── monitor.py                    #     Main monitoring loop
β”‚   β”œβ”€β”€ connectivity_monitor.py           #   Wrapper script
β”‚   β”œβ”€β”€ connectivity-monitor@.service     #   systemd service file for Linux
β”‚   └── README.md                         #   Python-specific documentation
β”œβ”€β”€ docs/                                 # Documentation
β”‚   β”œβ”€β”€ CONFIGURATION.md                  #   Configuration guide
β”‚   └── API.md                            #   Web dashboard & API reference
β”œβ”€β”€ README.md                             # This file
β”œβ”€β”€ CONTRIBUTING.md                       # Contribution guidelines
└── CODE_OF_CONDUCT.md                    # Community code of conduct

Documentation

Document Description
README.md Project overview and quick start (this file)
windows/README.md Windows PowerShell setup and usage
macos/README.md macOS Bash setup and usage
python/README.md Python cross-platform setup, CLI options, and Raspberry Pi guide
docs/CONFIGURATION.md Full configuration reference and CSV log format
docs/API.md Web dashboard and JSON API reference
CONTRIBUTING.md How to contribute to the project
CODE_OF_CONDUCT.md Community code of conduct

Contributing

This project is open source and contributions are welcome β€” code, documentation, bug reports, feature ideas, and more. If you've got an idea, found a bug, or want to add a feature β€” go for it.

  • Fork the repo and make your changes
  • Open a pull request with a clear description of what you changed and why
  • Report bugs by opening an issue β€” include what you were doing, what happened, and what you expected

See CONTRIBUTING.md for full guidelines.

If you find this useful, give it a star β€” it helps other people find it and motivates continued development.


License

This project doesn't currently have a formal license. If you want to use it, go ahead. Attribution is appreciated but not required.


Credits

Built by James Coates with assistance from Claude (via GitHub Copilot).

If this tool saved you a headache or helped you catch your ISP slacking, consider starring the repo. It's a small thing but it goes a long way.

Releases

No releases published

Packages

 
 
 

Contributors