https://github.com/sodabyte/simple-sysmonitor-api
A simple system monitoring API written in Go, exposing system metrics (memory, disk usage, CPU, and processes) over HTTP.
https://github.com/sodabyte/simple-sysmonitor-api
api golang rest-api
Last synced: about 1 year ago
JSON representation
A simple system monitoring API written in Go, exposing system metrics (memory, disk usage, CPU, and processes) over HTTP.
- Host: GitHub
- URL: https://github.com/sodabyte/simple-sysmonitor-api
- Owner: sodabyte
- Created: 2024-11-10T02:03:32.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-10T03:57:50.000Z (over 1 year ago)
- Last Synced: 2025-02-06T03:41:33.357Z (over 1 year ago)
- Topics: api, golang, rest-api
- Language: Go
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This is a personal project for learning Go, exposing system monitoring data via an HTTP API for easy integration with web UIs.
## Notes
- The binary is mainly run in Termux. It may work on other Linux machines, but this hasn't been fully tested.
- To successfully retrieve CPU and partition data, the application must be run with **superuser** privileges. (Yes, my device is rooted with magisk.)
- The API will panic if the `/cpu-usage` endpoint is accessed without superuser privileges.
## Endpoints
- `GET /processes` - List of running processes.
- `DELETE /processes/:pid` - Kill a process by its PID.
- `GET /disk-usage` - Disk usage statistics.
- `GET /disk-io` - Disk input/output statistics.
- `GET /partitions` - System partition information.
- `GET /memory-usage` - Memory usage statistics.
- `GET /cpu-usage` - CPU usage statistics.
## Contribution
Feel free to open issues or pull requests if you'd like to contribute.