The System Monitor program is designed to monitor and display real-time system information such as CPU usage, memory usage, and more. It utilizes a WebSocket for real-time updates and provides an API endpoint to fetch the latest system information.
- Go (version 1.16 or higher)
- BoltDB (embedded key/value database)
- Gorilla WebSocket (for WebSocket functionality)
- Gin (for API functionality)
- Clone the repository
- Navigate to the root directory of the repository
- Install dependencies with
go mod download
- Build the program with
go build -o system-monitor
- Run the program with
./system-monitor
The web interface is available at http://localhost:8081/static
. It displays the latest system information and updates in real-time.
The WebSocket is available at ws://localhost:8081/ws
. It sends the latest system information in JSON format every second.
The API is available at http://localhost:8081/api/system-info
. It returns the latest system information in JSON format.
.
|-- main.go
|-- static/
| |-- index.html
|-- api/
| |-- api.go
|-- websocket/
| |-- websocket.go
|-- database/
| |-- database.go
|-- models/
| |-- models.go
|-- utils/
| |-- utils.go
|-- websocket/
| |-- websocket.go
|-- webserver/
| |-- webserver.go
|-- out/
| |-- system-monitor.log
|-- database.db
|-- go.mod
|-- go.sum
|-- README.md
This project is licensed under the MIT License. See the LICENSE file for details.