Skip to content

Latest commit

 

History

History
46 lines (32 loc) · 924 Bytes

File metadata and controls

46 lines (32 loc) · 924 Bytes

Linux Monitor

A small Go terminal application for Linux system stats:

  • CPU usage
  • RAM and swap usage
  • Root disk usage and available space
  • Public IP address with country flag and location
  • Current inbound and outbound ethernet throughput

Run

Install Go 1.22 or newer, then run:

go run .

The application runs directly in the terminal and refreshes every 2 seconds. Press Ctrl+C to exit.

To change the refresh interval:

go run . -refresh 1s

To print one update and exit:

go run . -once

Build

Create an Ubuntu executable:

go build -o linux-mon .
./linux-mon

The app reads local metrics from /proc, /sys/class/net, and statfs. Public IP geolocation tries https://ipwho.is/ first, then falls back to http://ip-api.com/ if the first provider times out or fails. Successful lookups are cached for 24 hours and failed lookups are cached for 15 minutes.