Internet monitoring tool with speed test and downtime tracking.
uptime-guard
is a self-contained command-line tool written in Go to monitor your internet connection's speed and uptime.
It periodically performs speed tests and connectivity checks, recording the results and downtime events in an SQLite database.
This data can be used for analysis, helping you understand your internet service performance over time and potentially identify issues with your ISP.
Important
The project is currently under active development.
- Periodic internet speed testing (Download, Upload, Ping).
- Utilizes the
showwin/speedtest-go
library for native Go speed tests against Speedtest.net servers. - Periodic internet connectivity checks.
- Detection and recording of internet downtime events with start and end times.
- Persistence of speed test results and downtime events in a local SQLite database.
- Configurable intervals for speed tests and connectivity checks.
- Basic graceful shutdown on receiving termination signals (like Ctrl+C).
Currently, uptime-guard
is distributed using . To use it, you'll need to have Go installed (version 1.18 or higher recommended).
-
Install the tool:
go install github.com/deadpyxel/uptime-guard@latest
-
Run the application:
uptime-guard
The tool will start monitoring your internet connection. A
uptimeguard.db
file will be created in the same directory to store the data.To stop the application, press
Ctrl+C
.
uptime-guard
is primarily a long-running background process.
-
Running: Execute
go run main.go
or build the executable and run it. -
Configuration: Currently, the intervals for speed tests and connectivity checks are hardcoded in
main.go
. Future versions will include external configuration options. -
Data: The collected data is stored in the
uptimeguard.db
SQLite file. You can use any SQLite browser tool (like DB Browser for SQLite) to view and analyze the data directly.speed_tests
table: Contains records of each speed test performed.downtime_events
table: Contains records of detected internet outages.
We welcome contributions! If you'd like to contribute to uptime-guard
, here's how to get started:
-
Prerequisites:
- Go (version 1.18+)
- Git
-
Clone the repository:
git clone https://github.com/deadpyxel/uptime-guard.git cd uptime-guard
-
Install dependencies: Go Modules will automatically handle this when you build or run the project.
go build
-
Run the code:
go run main.go
-
Run tests:
go test ./...
This will run all tests in the project.
-
Code Style: We generally follow standard Go idioms and best practices.
- External configuration options (e.g., using YAML or command-line flags) for intervals, database path, etc.
- More robust error handling and logging.
- Implementation of data retrieval functions to calculate and display statistics within the application.
- A simple web frontend using HTMX and Templ for visualizing data.
- Packaging the application for easier distribution (e.g., using GoReleaser).
- Adding more comprehensive tests.
We welcome contributions from the community! Please see the CONTRIBUTING guide for details on how to contribute.
This project utilizes the following excellent open-source libraries:
- github.com/mattn/go-sqlite3 - SQLite driver for Go.
- github.com/showwin/speedtest-go - Go native Speedtest.net client library.
We are grateful to the maintainers and contributors of these projects.
This project is licensed under the MIT License. See the LICENSE file for details.