Skip to content

Repository files navigation

🌐 Internet Connectivity Monitor

A lightweight Windows desktop utility that quietly watches your internet connection, records every disconnect/reconnect with exact timestamps and durations, shows the stats in a clean dashboard, and can email you a daily report.

It runs as a single .exeno installer, no Windows service, no admin rights, and no Python required on the machine that runs it. Everything lives in the system tray.

Open Source · Free to Use — MIT licensed.


✨ Features

  • One-file executableInternetMonitor.exe bundles everything; nothing to install.
  • Lives in the system tray — closing a window doesn’t quit it; it keeps monitoring in the background until you choose Quit.
  • Accurate, debounced detection — probes Google / Cloudflare / Quad9 DNS and only flags an outage after consecutive failures, so a single dropped packet won’t cause a false alarm.
  • Dashboard with a date-range filter (24h / 7d / 30d / All or custom): availability %, uptime, downtime, outage count, longest & average outage, a color-coded timeline, and a full event log.
  • Beautiful HTML reports generated on a schedule and on demand.
  • Daily email report over SMTP (Gmail/Outlook/any server), at a time you choose.
  • Launch at Windows startup — a built-in toggle (per-user, no admin), not a service.
  • Crash-safe — all transitions are appended to events.jsonl; the monitor resumes its state after a restart.

🚀 Quick start (just run it)

  1. Download InternetMonitor.exe from the Releases page (or build it yourself — see below).

  2. Put it in any folder you like (it creates its data files next to itself).

  3. Double-click it. A globe icon appears in the system tray (bottom-right).

  4. Right-click the tray icon for the menu:

    Menu item What it does
    Connection: … Shows the current state (Connected / Disconnected)
    Open Dashboard Live stats window with a date filter
    Settings Monitoring options + email setup
    View Latest Report Opens the newest HTML report
    Generate Report Now Builds a report over all history and opens it
    Open Reports Folder Opens the reports\ folder
    Launch at Windows Startup Toggle auto-start on login (✓ = on)
    About Developer / company / license info
    Quit Fully stops the app

Do I need Python installed to run the .exe? No. The executable bundles the Python runtime and all libraries. Any 64‑bit Windows 10/11 PC can run it with nothing installed. Python is only needed if you want to build the exe or run from source.


⚙️ Configuration

Open Settings from the tray menu (or edit config.json next to the exe).

Monitoring

Setting Meaning Default
Connectivity check interval Seconds between checks 5
Failed checks before marking offline Debounce threshold 2
Auto-save HTML report every (hours) Scheduled report cadence 12
Connection probe timeout Seconds to wait per probe 3

Monitoring changes apply automatically on the next check — no restart needed.

📧 Daily email report

In Settings → Email Report:

  1. Tick “Email me a connectivity report every day”.
  2. Set the send time (24-hour HH:MM).
  3. Enter your SMTP details and the From / To addresses, then Save.
  4. Click Send Test Email to confirm it works.

Gmail example

Field Value
SMTP server smtp.gmail.com
Port 587
Use STARTTLS
Username you@gmail.com
Password a Google App Password (not your normal password)
  • Port 465 uses SSL automatically; 587 uses STARTTLS; 25 is plain.
  • The password is masked on screen (toggle Show password to reveal). In config.json it is stored masked (base64) — this hides it from casual viewing but is not encryption, so keep that folder private.

🖥️ Build the .exe yourself

You only need this if you want to produce the executable (end users don’t).

Requirements: Windows + Python 3.10+.

git clone https://github.com/azeemgujjar/net-monitering.git
cd net-monitering
build.bat

That’s it. build.bat will:

  1. install the dependencies (pystray, Pillow) and PyInstaller,
  2. generate the app icon (app.ico),
  3. produce dist\InternetMonitor.exe — a single self-contained file.

Or run the steps manually:

python -m pip install -r requirements.txt
python make_icon.py
python -m PyInstaller --onefile --windowed --name InternetMonitor --icon app.ico --clean net_monitor_app.py

🧑‍💻 Run from source (for development)

git clone https://github.com/azeemgujjar/net-monitering.git
cd net-monitering
python -m pip install -r requirements.txt

pythonw net_monitor_app.py      :: tray app, no console
python  net_monitor_app.py      :: tray app, with a console for logs

The monitoring engine can also run headless from the command line:

python net_monitor.py           :: run the monitor in the foreground (Ctrl+C to stop)
python net_monitor.py --report  :: generate a report over all history and open it

🛠️ Development guide

Project structure

.
├── net_monitor_app.py   # Desktop app (entry point): tray icon, dashboard,
│                         #   settings, About, email scheduler, auto-start
├── net_monitor.py       # Engine: connectivity checks, event log, stats,
│                         #   HTML report generation, SMTP email
├── make_icon.py         # Generates app.ico for the build
├── build.bat            # One-click build -> dist/InternetMonitor.exe
├── requirements.txt     # pystray, Pillow, pyinstaller
├── app.ico              # Application icon
├── LICENSE              # MIT
└── README.md

Files created at runtime (next to the script/exe, git-ignored): config.json, events.jsonl, state.json, email_state.json, monitor.log, reports/.

Architecture

net_monitor.py is a self-contained, importable engine. net_monitor_app.py drives it and adds the GUI. The app runs four cooperating threads:

Thread Responsibility
Main Tkinter — owns all GUI; runs root.mainloop()
Monitor net_monitor.run_monitor() — probes, logs, auto-reports
Email Daily scheduler — sends the report at the configured time
Tray pystray icon loop

Tray-menu callbacks marshal any GUI work back onto the Tk thread via root.after(...), because Tkinter is not thread-safe.

Key design points worth knowing before you change things:

  • State is file-based. events.jsonl is the source of truth; the dashboard and reports are both rebuilt from it via compute_stats(), so their numbers always agree.
  • Frozen-path aware. When bundled, data files are written next to the .exe (sys.executable’s folder), not PyInstaller’s temp dir.
  • Single instance. A named Windows mutex prevents duplicate tray icons.
  • Auto-start is a per-user registry Run entry — not a service, no admin.

Common modifications

  • Add a config option: add it to DEFAULT_CONFIG in net_monitor.py (and _INT_CONFIG_KEYS if it’s an integer), then add a field to the Settings window in net_monitor_app.py.
  • Change probe targets: edit PROBE_TARGETS in net_monitor.py.
  • Restyle the HTML report: edit the <style> block in generate_report().
  • Restyle the dashboard: the color palette constants are at the top of net_monitor_app.py.

After changing code, just re-run build.bat to produce a fresh exe.


❓ Troubleshooting

  • Tray icon doesn’t appear — it may be hidden in the “show hidden icons” overflow (the ^ arrow near the clock). Drag it onto the taskbar to pin it.
  • Email fails — use a provider App Password (Gmail/Outlook block normal passwords for SMTP), verify host/port, and use Send Test Email to see the exact error.
  • SmartScreen warning on the exe — unsigned executables show a “Windows protected your PC” prompt: click More info → Run anyway. (Code signing requires a paid certificate.)
  • Upgrading from the old headless version — if you previously ran pythonw net_monitor.py via the Startup folder or Task Scheduler, remove that entry so two monitors don’t write to the same log; then use the app’s Launch at Windows Startup toggle instead.

🤝 Contributing

Contributions are welcome! Please:

  1. Fork the repo and create a feature branch.
  2. Keep it dependency-light (standard library where possible).
  3. Test by running from source (python net_monitor_app.py) and by building the exe (build.bat) before opening a PR.
  4. Open a pull request describing the change.

Bug reports and feature requests via Issues are appreciated too.


📄 License

Released under the MIT License — free to use, modify, and distribute. See LICENSE.


👤 Credits

If you find this useful, a ⭐ on the repository is appreciated!

About

Sue your ISP incase if they says your internet is working fine.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages