{"id":23642055,"url":"https://github.com/mambuzrrr/linux-system-information-api","last_synced_at":"2026-04-30T08:33:27.132Z","repository":{"id":265550895,"uuid":"896232833","full_name":"mambuzrrr/Linux-System-Information-API","owner":"mambuzrrr","description":"Linux System API (CPU, RAM, Disk, Network \u0026 System Load)","archived":false,"fork":false,"pushed_at":"2024-11-29T21:10:07.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-28T10:39:03.008Z","etag":null,"topics":["api","cpu-monitoring","disk","go","golang","linux","load","network","ram","shell"],"latest_commit_sha":null,"homepage":"https://bjx.devluxe.eu","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mambuzrrr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-29T20:49:03.000Z","updated_at":"2024-11-29T21:13:19.000Z","dependencies_parsed_at":"2024-11-29T22:37:07.533Z","dependency_job_id":null,"html_url":"https://github.com/mambuzrrr/Linux-System-Information-API","commit_stats":null,"previous_names":["mambuzrrr/linux-system-information-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mambuzrrr%2FLinux-System-Information-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mambuzrrr%2FLinux-System-Information-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mambuzrrr%2FLinux-System-Information-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mambuzrrr%2FLinux-System-Information-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mambuzrrr","download_url":"https://codeload.github.com/mambuzrrr/Linux-System-Information-API/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239579791,"owners_count":19662670,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","cpu-monitoring","disk","go","golang","linux","load","network","ram","shell"],"created_at":"2024-12-28T10:39:08.688Z","updated_at":"2025-10-08T16:05:34.970Z","avatar_url":"https://github.com/mambuzrrr.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🖥️ System Stats API for Linux\n\n## About\nLightweight, fast system monitoring API written in Go.  \nProvides CPU, memory, disk, network and load metrics with both **raw** values and **strings**, e.g. `1.23 GB`, `12.34%`). Built for Linux (Debian/Ubuntu).\n\n---\n\n## 🌟 Key Features\n- Background **StatsCollector** with configurable refresh interval (caches metrics to reduce request latency).  \n- Endpoints return both **raw** and **readable** fields for easy UI/alerts and programmatic use.  \n- `/health` endpoint (uptime, version, time).  \n- Logging + panic recovery middleware.  \n- Simple CORS header (`Access-Control-Allow-Origin: *`).  \n- Graceful shutdown (SIGINT/SIGTERM) and HTTP timeouts.  \n- Configurable via `config.json`.\n\n---\n\n## 🚀 Quickstart\n\n### 1. Clone\n```bash\ngit clone https://github.com/mambuzrrr/brejax-system-stats-api.git\ncd brejax-system-stats-api\n```\n\n### 2. Install dependencies\nMake sure you have Go installed (`go version` should return a valid version).\n\n```bash\ngo mod tidy\n```\n\n### 3. Configure the API\nEdit the `config.json` file to customize your port and endpoint paths:\n```bash\n{\n  \"port\": 8123,\n  \"refresh_interval_sec\": 5,\n  \"version\": \"0.1.0\",\n  \"endpoints\": {\n    \"stats\": \"/system-stats\",\n    \"cpu\": \"/cpu-info\",\n    \"memory\": \"/memory-info\",\n    \"disk\": \"/disk-info\",\n    \"network\": \"/network-info\",\n    \"load\": \"/load-info\",\n    \"health\": \"/health\"\n  }\n}\n```\n\n### 4. Run the server\n```bash\ngo run main.go\n```\n\n## 📡 API Endpoints\n|Endpoint|Description|\n| --- | --- | \n| `/system-stats` | Full system stats: CPU, memory, disk, etc. | \n| `/cpu-info` | Current CPU usage percentage. | \n| `/memory-info` | RAM usage (total, used, percentage). |\n| `/disk-info` | Disk usage (total, used, percentage). |\n| `/network-info` | Network I/O statistics. |\n| `/load-info` | System load averages (1, 5, 15 mins). |\n| `/health` | Service health: `status`, `uptime`, `version`, `time` |\n\n### Example: Full Stats Output (`/system-stats`)\n```bash\n{\n  \"cpu\": {\n    \"raw\": [1.23],\n    \"readable\": [\"1.23%\"]\n  },\n  \"memory\": {\n    \"total\": 33554432000,\n    \"total_readable\": \"31.25 GB\",\n    \"used\": 2264924160,\n    \"used_readable\": \"2.11 GB\",\n    \"used_percent\": 6.76,\n    \"used_percent_readable\": \"6.76%\"\n  },\n  \"disk\": {\n    \"total\": 500107862016,\n    \"total_readable\": \"465.66 GB\",\n    \"used\": 200123435008,\n    \"used_readable\": \"186.38 GB\",\n    \"used_percent\": 40.02,\n    \"used_percent_readable\": \"40.02%\"\n  },\n  \"network\": [\n    {\n      \"name\": \"eth0\",\n      \"bytes_sent\": 123456789,\n      \"bytes_sent_readable\": \"117.74 MB\",\n      \"bytes_recv\": 987654321,\n      \"bytes_recv_readable\": \"941.90 MB\"\n    }\n  ],\n  \"system_load\": {\n    \"raw\": {\"load1\": 0.12, \"load5\": 0.15, \"load15\": 0.18},\n    \"readable\": {\"load1\": \"0.12\", \"load5\": \"0.15\", \"load15\": \"0.18\"}\n  },\n  \"updated_at\": \"2025-09-12T13:13:34Z\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmambuzrrr%2Flinux-system-information-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmambuzrrr%2Flinux-system-information-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmambuzrrr%2Flinux-system-information-api/lists"}