diff options
| -rw-r--r-- | gemfeed/2008-06-26-perl-poetry.md | 1 | ||||
| -rw-r--r-- | gemfeed/2011-05-07-perl-daemon-service-framework.md | 1 | ||||
| -rw-r--r-- | gemfeed/2022-05-27-perl-is-still-a-great-choice.md | 1 | ||||
| -rw-r--r-- | gemfeed/2023-05-01-unveiling-guprecords:-uptime-records-with-raku.md | 1 | ||||
| -rw-r--r-- | gemfeed/2025-11-02-perl-new-features-and-foostats.md | 1 | ||||
| -rw-r--r-- | gemfeed/2026-02-15-loadbars-resurrected-from-perl-to-go.md | 226 | ||||
| -rw-r--r-- | gemfeed/2026-02-29-loadbars-0.13.0-released.md | 196 | ||||
| -rw-r--r-- | gemfeed/index.md | 2 | ||||
| -rw-r--r-- | gemfeed/loadbars-0.13.0-released/loadbars.gif (renamed from gemfeed/loadbars-resurrected-from-perl-to-go/loadbars.gif) | bin | 93467 -> 93467 bytes | |||
| -rw-r--r-- | index.md | 2 |
10 files changed, 198 insertions, 233 deletions
diff --git a/gemfeed/2008-06-26-perl-poetry.md b/gemfeed/2008-06-26-perl-poetry.md index 5de6d634..3145956b 100644 --- a/gemfeed/2008-06-26-perl-poetry.md +++ b/gemfeed/2008-06-26-perl-poetry.md @@ -173,7 +173,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -[2026-02-15 Loadbars resurrected: From Perl to Go after 15 years](./2026-02-15-loadbars-resurrected-from-perl-to-go.md) [2025-11-02 Perl New Features and Foostats](./2025-11-02-perl-new-features-and-foostats.md) [2022-05-27 Perl is still a great choice](./2022-05-27-perl-is-still-a-great-choice.md) [2011-05-07 Perl Daemon (Service Framework)](./2011-05-07-perl-daemon-service-framework.md) diff --git a/gemfeed/2011-05-07-perl-daemon-service-framework.md b/gemfeed/2011-05-07-perl-daemon-service-framework.md index 277d7bb2..c6d6c891 100644 --- a/gemfeed/2011-05-07-perl-daemon-service-framework.md +++ b/gemfeed/2011-05-07-perl-daemon-service-framework.md @@ -175,7 +175,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -[2026-02-15 Loadbars resurrected: From Perl to Go after 15 years](./2026-02-15-loadbars-resurrected-from-perl-to-go.md) [2025-11-02 Perl New Features and Foostats](./2025-11-02-perl-new-features-and-foostats.md) [2022-05-27 Perl is still a great choice](./2022-05-27-perl-is-still-a-great-choice.md) [2011-05-07 Perl Daemon (Service Framework) (You are currently reading this)](./2011-05-07-perl-daemon-service-framework.md) diff --git a/gemfeed/2022-05-27-perl-is-still-a-great-choice.md b/gemfeed/2022-05-27-perl-is-still-a-great-choice.md index 69f198a7..b881eb78 100644 --- a/gemfeed/2022-05-27-perl-is-still-a-great-choice.md +++ b/gemfeed/2022-05-27-perl-is-still-a-great-choice.md @@ -147,7 +147,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -[2026-02-15 Loadbars resurrected: From Perl to Go after 15 years](./2026-02-15-loadbars-resurrected-from-perl-to-go.md) [2025-11-02 Perl New Features and Foostats](./2025-11-02-perl-new-features-and-foostats.md) [2023-05-01 Unveiling `guprecords.raku`: Global Uptime Records with Raku](./2023-05-01-unveiling-guprecords:-uptime-records-with-raku.md) [2022-05-27 Perl is still a great choice (You are currently reading this)](./2022-05-27-perl-is-still-a-great-choice.md) diff --git a/gemfeed/2023-05-01-unveiling-guprecords:-uptime-records-with-raku.md b/gemfeed/2023-05-01-unveiling-guprecords:-uptime-records-with-raku.md index 9f167aff..d7f41dfd 100644 --- a/gemfeed/2023-05-01-unveiling-guprecords:-uptime-records-with-raku.md +++ b/gemfeed/2023-05-01-unveiling-guprecords:-uptime-records-with-raku.md @@ -163,7 +163,6 @@ E-Mail your comments to hi@foo.zone :-) Other related posts are: -[2026-02-15 Loadbars resurrected: From Perl to Go after 15 years](./2026-02-15-loadbars-resurrected-from-perl-to-go.md) [2025-11-02 Perl New Features and Foostats](./2025-11-02-perl-new-features-and-foostats.md) [2023-05-01 Unveiling `guprecords.raku`: Global Uptime Records with Raku (You are currently reading this)](./2023-05-01-unveiling-guprecords:-uptime-records-with-raku.md) [2022-06-15 Sweating the small stuff - Tiny projects of mine](./2022-06-15-sweating-the-small-stuff.md) diff --git a/gemfeed/2025-11-02-perl-new-features-and-foostats.md b/gemfeed/2025-11-02-perl-new-features-and-foostats.md index aa6f2093..68b37750 100644 --- a/gemfeed/2025-11-02-perl-new-features-and-foostats.md +++ b/gemfeed/2025-11-02-perl-new-features-and-foostats.md @@ -390,7 +390,6 @@ E-Mail your comments to `paul@nospam.buetow.org` :-) Other related posts are: -[2026-02-15 Loadbars resurrected: From Perl to Go after 15 years](./2026-02-15-loadbars-resurrected-from-perl-to-go.md) [2025-11-02 Perl New Features and Foostats (You are currently reading this)](./2025-11-02-perl-new-features-and-foostats.md) [2023-05-01 Unveiling `guprecords.raku`: Global Uptime Records with Raku](./2023-05-01-unveiling-guprecords:-uptime-records-with-raku.md) [2022-05-27 Perl is still a great choice](./2022-05-27-perl-is-still-a-great-choice.md) diff --git a/gemfeed/2026-02-15-loadbars-resurrected-from-perl-to-go.md b/gemfeed/2026-02-15-loadbars-resurrected-from-perl-to-go.md deleted file mode 100644 index b52209fe..00000000 --- a/gemfeed/2026-02-15-loadbars-resurrected-from-perl-to-go.md +++ /dev/null @@ -1,226 +0,0 @@ -# Loadbars resurrected: From Perl to Go after 15 years - -> Published at 2026-02-14T22:43:27+02:00 - -Who remembers Loadbars? The small, humble server load monitoring tool I wrote back in November 2010 as a Perl+SDL project during my first job after graduating from university as a Linux Sysadmin. That was over 15 years ago. After being effectively dead for more than a decade, Loadbars is working again -- rewritten in Go from Perl with the help of AI (Claude Code), and it even works on macOS now (as a client). - -[](./loadbars-resurrected-from-perl-to-go/loadbars.gif) - -[Loadbars on Codeberg](https://codeberg.org/snonux/loadbars) - -## Table of Contents - -* [⇢ Loadbars resurrected: From Perl to Go after 15 years](#loadbars-resurrected-from-perl-to-go-after-15-years) -* [⇢ ⇢ What Loadbars is (and isn't)](#what-loadbars-is-and-isn-t) -* [⇢ ⇢ Why the rewrite was necessary](#why-the-rewrite-was-necessary) -* [⇢ ⇢ A brief history](#a-brief-history) -* [⇢ ⇢ Features](#features) -* [⇢ ⇢ ⇢ CPU monitoring](#cpu-monitoring) -* [⇢ ⇢ ⇢ Memory monitoring](#memory-monitoring) -* [⇢ ⇢ ⇢ Network monitoring](#network-monitoring) -* [⇢ ⇢ ⇢ All hotkeys](#all-hotkeys) -* [⇢ ⇢ ⇢ SSH and multi-host support](#ssh-and-multi-host-support) -* [⇢ ⇢ ⇢ Config file](#config-file) -* [⇢ ⇢ ⇢ macOS support](#macos-support) -* [⇢ ⇢ Building from source](#building-from-source) -* [⇢ ⇢ Tested platforms](#tested-platforms) -* [⇢ ⇢ Future-proof with Go](#future-proof-with-go) -* [⇢ ⇢ The AI rewrite experience](#the-ai-rewrite-experience) - -## What Loadbars is (and isn't) - -Loadbars is a real-time server load monitoring tool. It connects to one or more Linux hosts via SSH and shows CPU, memory, and network usage as vertical colored bars in an SDL window. You can also run it locally without SSH. It shows the current state only -- like `top` or `vmstat`, but visual and across multiple hosts at once. All you need is a working SSH connection through an SSH Agent. - -It is not a tool for collecting loads and drawing graphs for later analysis. There is no history, no recording, no database. Tools like Prometheus or Grafana require significant setup time before producing results. Loadbars lets you observe the current state immediately. You install one binary, point it at your servers, and see what's happening right now. - -``` -┌─ Loadbars 0.9.0 ──────────────────────────────────────────┐ -│ │ -│ ████ ████ ████ ██ ████ ████ ████ ██ ░░██ ░░██ │ -│ ████ ████ ████ ██ ████ ████ ████ ██ ░░██ ░░██ │ -│ ████ ████ ████ ██ ████ ████ ████ ██ ░░██ ░░██ │ -│ ████ ████ ████ ██ ████ ████ ████ ██ ░░██ ░░██ │ -│ ████ ████ ████ ██ ████ ████ ████ ██ ░░██ ░░██ │ -│ ▓▓▓▓ ▓▓▓▓ ▓▓▓▓ ▓▓ ▓▓▓▓ ▓▓▓▓ ▓▓▓▓ ▓▓ ░░▓▓ ░░▓▓ │ -│ CPU cpu0 cpu1 mem CPU cpu0 cpu1 mem net net │ -│ └──── host1 ────┘ └──── host2 ────┘ │ -└───────────────────────────────────────────────────────────┘ -``` - -## Why the rewrite was necessary - -I'd have liked to have kept the Perl version. Perl was the first language I learned properly, and I have a soft spot for it. But there was an (for me) unresolvable multithreading issue related to recent Perl and SDL library versions. Perl's `ithreads` and SDL doesn't work reliably anymore, and debugging decade-old thread-safety issues in XS bindings is not a productive use of time. - -I actually tried to fix the Perl version first. I had Claude Code (CLI, running Opus 5.3) attempt to resolve the segfault involving Perl's multi-threading and SDL. It couldn't—the issue is deep in the XS bindings and not something you can fix from Perl-land (nor did I want to invest my own time in it either). So the more pragmatic thing to do was to let Claude Code rewrite the whole thing in Go instead. That worked without any major issues. The Go version is cleaner and easier to deploy (single static binary), and now has proper unit tests. - -I could have redesigned the Perl version to make it work, but I think Go is the better choice in this case. The important thing: for the user, nothing changes. The rewrite's usage, look, and feel are de-facto identical to the old Perl version. The same hotkeys, the same bar layout, the same colors, the same config file format. If you used Loadbars ten years ago, you can pick up the new version and everything works exactly as you remember. The only difference is under the hood. - -## A brief history - -The first commit is from November 5, 2010—over 15 years ago. Back then, it was called `cpuload` and was a quick Perl+SDL hack I wrote at work to keep an eye on a fleet of Linux servers. It grew into Loadbars over the following weeks, gaining memory and network monitoring, ClusterSSH integration, and a config file. The last meaningful Perl development was around 2013. Around that time, there were already a couple of colleagues who used Loadbars frequently. But then I changed my job role and later even jobs, and I stopped development of Loadbars. - -For the next decade, it sat dormant. I occasionally thought about reviving it, but Perl+SDL threading issues made it impractical. In February 2026, I finally sat down with Claude Code and let it rewrite the whole thing in Go in a single session. - -## Features - -### CPU monitoring - -CPU usage is shown as vertical colored bars. Each bar is stacked from bottom to top with the following segments: - -* System (blue) -- kernel CPU time -* User (yellow) -- user-space CPU time; turns dark yellow above 50%, orange above 70% -* Nice (green) -- low-priority user processes -* Idle (black) -- unused CPU -* IOwait (purple) -- waiting for disk I/O -* IRQ / SoftIRQ (white) -- interrupt handling -* Guest (red) -- time spent running virtual CPUs -* Steal (red) -- time stolen by the hypervisor - -Press `1` to toggle between one aggregate bar per host and one bar per core. Press `e` for extended mode, which adds a 1px peak line showing the maximum system+user percentage over the last N samples. - -### Memory monitoring - -Press `2` to toggle memory bars. Each host gets one bar split in two halves: - -* Left half: RAM usage (dark grey = used, black = free) -* Right half: Swap usage (grey = used, black = free) - -### Network monitoring - -Press `3` to toggle network bars. Loadbars sums RX and TX bytes across all non-loopback interfaces (e.g. `eth0`, `wlan0`, `enp0s3`) and shows the combined total. Loopback (`lo`) is always excluded. Each net bar has two halves: - -* Left half: RX (received) growing from the top (light green) -* Right half: TX (transmitted) growing from the bottom (light green) - -Network utilization is shown as a percentage of the configured link speed. The default link speed is `gbit` (1 Gbps). Change it with `--netlink` or in the config file. Press `f`/`v` to scale the link speed up or down during runtime (cycles through mbit, 10mbit, 100mbit, gbit, 10gbit). - -If the net bar is red, it means no non-loopback interface was found on that host. - -### All hotkeys - -``` -Key Action -───── ────────────────────────────────────────────────── -1 Toggle CPU cores (aggregate vs per-core bars) -2 Toggle memory bars -3 Toggle network bars (aggregated across interfaces) -e Toggle extended display (peak line on CPU bars) -h Print hotkey list to stdout -q Quit -w Write current settings to ~/.loadbarsrc -a / y Increase / decrease CPU average samples -d / c Increase / decrease net average samples -f / v Link scale up / down (net utilization reference) -Arrows Resize window (left/right: width, up/down: height) -``` - -### SSH and multi-host support - -Loadbars connects to remote hosts via SSH using public key authentication. No agent or special setup is needed on the remote side -- Loadbars embeds a small bash script in the binary and runs it via `bash -s` over SSH. The remote hosts only need bash and `/proc` (i.e. Linux). - -``` -loadbars --hosts server1,server2,server3 - -loadbars --hosts root@server1,root@server2 - -loadbars servername{01..50}.example.com --showcores 1 -``` - -Shell brace expansion works for specifying ranges of hosts. You can also use ClusterSSH cluster definitions from `/etc/clusters`: - -``` -loadbars --cluster production -``` - -When no hosts are given, Loadbars runs locally on `localhost` without SSH. - -### Config file - -Loadbars reads `~/.loadbarsrc` on startup. Any option from `--help` can be set there without the leading `--`. Comments use `#`. Press `w` during runtime to write the current settings to the config file. - -``` -showcores=1 -showmem=1 -shownet=1 -extended=1 -netlink=gbit -cpuaverage=10 -netaverage=15 -height=150 -barwidth=1200 -``` - -### macOS support - -macOS is supported as a client for monitoring remote Linux servers via SSH. Local monitoring on macOS is not supported because it requires the `/proc` filesystem. The SDL window is automatically brought to the foreground on macOS. - -## Building from source - -Loadbars requires Go 1.25+ and SDL2. Install the SDL2 development libraries for your platform: - -``` -# Fedora / RHEL / CentOS -sudo dnf install SDL2-devel - -# macOS -brew install sdl2 -``` - -Then build with Mage (recommended) or plain Go: - -``` -mage build -./loadbars --hosts localhost - -# or without Mage: -go build -o loadbars ./cmd/loadbars -``` - -Install to `~/go/bin`: - -``` -mage install -``` - -Run tests: - -``` -mage test -# or: go test ./... -``` - -## Tested platforms - -* Fedora Linux 43 and most modern Linux distributions (RHEL, CentOS, Ubuntu, Debian, etc.) -* macOS (Darwin) as a client connecting to remote Linux servers via SSH - -Remote hosts must be Linux with `/proc` and bash. - -## Future-proof with Go - -One of the reasons I chose Go for the rewrite is Go's compatibility promise. The Go 1 compatibility guarantee means that code written today will continue to compile and work with future Go releases. No more bitrotted XS bindings, no more `ithreads` headaches, no more hunting for compatible versions of SDL Perl modules. - -The Go SDL2 bindings (go-sdl2) are actively maintained, and SDL2 itself is a stable, well-supported library. The entire application compiles to a single static binary with no runtime dependencies beyond SDL2. Deploy it anywhere, run it for years. - -## The AI rewrite experience - -This resurrection would not have been really possible without the help of AI. The rewrite was done with Claude Code CLI (Anthropic's coding agent) running Claude Opus 5.3. I pointed it at the Perl source, and let it produce the Go equivalent. The process was surprisingly smooth -- the rewrite worked without any major issues. There were some minor bugs (such as network bars not showing up initially, and/or some pixel errors in the bars), but they were sorted by Claude by providing screenshots of the problems! - -E-Mail your comments to `paul@nospam.buetow.org` :-) - -Other related posts: - -[2026-02-15 Loadbars resurrected: From Perl to Go after 15 years (You are currently reading this)](./2026-02-15-loadbars-resurrected-from-perl-to-go.md) -[2025-11-02 Perl New Features and Foostats](./2025-11-02-perl-new-features-and-foostats.md) -[2025-09-14 Bash Golf Part 4](./2025-09-14-bash-golf-part-4.md) -[2025-03-05 Sharing on Social Media with Gos v1.0.0](./2025-03-05-sharing-on-social-media-with-gos.md) -[2024-03-03 A fine Fyne Android app for quickly logging ideas programmed in Go](./2024-03-03-a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang.md) -[2023-12-10 Bash Golf Part 3](./2023-12-10-bash-golf-part-3.md) -[2023-06-01 KISS server monitoring with Gogios](./2023-06-01-kiss-server-monitoring-with-gogios.md) -[2022-05-27 Perl is still a great choice](./2022-05-27-perl-is-still-a-great-choice.md) -[2022-01-01 Bash Golf Part 2](./2022-01-01-bash-golf-part-2.md) -[2021-11-29 Bash Golf Part 1](./2021-11-29-bash-golf-part-1.md) -[2011-05-07 Perl Daemon (Service Framework)](./2011-05-07-perl-daemon-service-framework.md) -[2008-06-26 Perl Poetry](./2008-06-26-perl-poetry.md) - -[Back to the main site](../) diff --git a/gemfeed/2026-02-29-loadbars-0.13.0-released.md b/gemfeed/2026-02-29-loadbars-0.13.0-released.md new file mode 100644 index 00000000..74b0f1a7 --- /dev/null +++ b/gemfeed/2026-02-29-loadbars-0.13.0-released.md @@ -0,0 +1,196 @@ +# Loadbars 0.13.0 released + +> Published at 2026-02-29T00:00:00+02:00 + +Loadbars is a real-time server load monitoring tool. It connects to one or more Linux hosts via SSH and shows CPU, memory, network, load average, and disk I/O as vertical colored bars in an SDL window. You can run it locally or point it at your servers and see what's happening right now — like `top` or `vmstat`, but visual and across multiple hosts at once. + +[](./loadbars-0.13.0-released/loadbars.gif) + +Loadbars can connect to hundreds of servers in parallel; the GIF above doesn't do it justice — at scale you get a wall of bars that makes it easy to spot outliers and compare hosts at a glance. + +[Loadbars on Codeberg](https://codeberg.org/snonux/loadbars) + +## Table of Contents + +* [⇢ Loadbars 0.13.0 released](#loadbars-0130-released) +* [⇢ ⇢ What Loadbars is (and isn't)](#what-loadbars-is-and-isn-t) +* [⇢ ⇢ Use cases](#use-cases) +* [⇢ ⇢ What's new since the Perl version](#what-s-new-since-the-perl-version) +* [⇢ ⇢ Core features](#core-features) +* [⇢ ⇢ ⇢ Load average bars](#load-average-bars) +* [⇢ ⇢ ⇢ Disk I/O bars](#disk-io-bars) +* [⇢ ⇢ ⇢ Global reference lines and options](#global-reference-lines-and-options) +* [⇢ ⇢ ⇢ CPU monitoring](#cpu-monitoring) +* [⇢ ⇢ ⇢ Memory and network](#memory-and-network) +* [⇢ ⇢ ⇢ All hotkeys](#all-hotkeys) +* [⇢ ⇢ SSH and config](#ssh-and-config) +* [⇢ ⇢ Building and platforms](#building-and-platforms) + +## What Loadbars is (and isn't) + +Loadbars shows the current state only. It is not a tool for collecting loads and drawing graphs for later analysis. There is no history, no recording, no database. Tools like Prometheus or Grafana require significant setup before producing results. Loadbars lets you observe the current state immediately: one binary, SSH (or local), and you're done. + +``` +┌─ Loadbars 0.13.0 ─────────────────────────────────────────┐ +│ │ +│ ████ ████ ████ ██ ████ ████ ████ ██ ░░██ ░░██ │ +│ ████ ████ ████ ██ ████ ████ ████ ██ ░░██ ░░██ │ +│ ████ ████ ████ ██ ████ ████ ████ ██ ░░██ ░░██ │ +│ CPU cpu0 cpu1 mem CPU cpu0 cpu1 mem net net │ +│ └──── host1 ────┘ └──── host2 ────┘ │ +└───────────────────────────────────────────────────────────┘ +``` + +## Use cases + +* Deployments and rollouts: watch CPU, memory, and network across app servers or nodes while you deploy. Spot the one that isn't coming up or is stuck under load. +* Load testing: run your load tool against a cluster and see which hosts (or cores) are saturated, whether memory or disk I/O is the bottleneck, and how load spreads. +* Quick health sweep: no dashboards set up yet? SSH to a handful of hosts and run Loadbars. You get an instant picture of who's busy, who's idle, and who's swapping. +* Comparing hosts: side-by-side bars make it easy to see if one machine is hotter than the rest (e.g. after a config change or migration). +* NOC or on-call: glance at load average, CPU, and network for a known set of servers without opening multiple terminals or a heavy monitoring UI. +* Local tuning: run `loadbars --hosts localhost` while you benchmark or stress a single box; the bars and load-average view help correlate activity with what you're doing. + +## What's new since the Perl version + +The original Loadbars (Perl + SDL, ~2010–2013) had CPU, memory, network, ClusterSSH, and a config file. The Go rewrite and subsequent releases added the following. Why each one matters: + +* Load average bars: the Perl version had no load average. Now you get 1/5/15-minute load per host. Useful because load average is the classic "how queued is this box" signal — you see saturation and trends at a glance without reading numbers. + +* Disk I/O bars: disk was invisible in the Perl version. You now get read/write throughput (and optionally utilization %) per host or per device. Whole-disk devices only (partitions, loop, ram, zram, and device-mapper are excluded). Useful when you need to tell "is this slow because of CPU or because of disk?" — especially with many hosts, one disk-heavy host stands out. Disk smoothing (config diskaverage, hotkeys b/x) lets you tune how much the bars are averaged. + +* Extended peak line on CPU: a 1px line shows max system+user over the last N samples. Useful to see short spikes that the stacked bar might smooth out, so you don't miss bursty load. + +* Tooltips and host highlight: hover the mouse over any bar to see a tooltip with exact values (CPU %, memory, network, load, or disk depending on bar type). The hovered host's bars are highlighted (inverted) so you can tell which host you're over. Useful when you have hundreds of bars and want to read a specific number or confirm which host a bar belongs to. + +* GuestNice in CPU bars: CPU bars now show GuestNice as a lime green segment (above Nice). One more breakdown for virtualized or container workloads. + +* Version in window title: the default SDL title is "Loadbars <version> (press h for help on stdout)". Override with --title when you need a custom label. + +* Global average CPU line (key g): a single red line across all hosts at the fleet-average CPU. Useful when you have hundreds of bars: you instantly see which hosts are above or below average without comparing bar heights in your head. + +* Global I/O average line (key i): same idea for iowait+IRQ. Useful to spot which hosts are waiting on I/O more than the rest — quick way to find the disk-bound or interrupt-heavy machines. + +* Host separator lines (key s): a thin red vertical line between each host's bars. Useful at scale so you don't lose track of where one host ends and the next begins when the window is full of bars. + +* Scale reset (key r): reset the auto-scale for load and disk back to the floor. Useful after a big spike so the bars don't stay compressed for the rest of the session. + +* Toggle CPU off (key 1 cycles through aggregate → per-core → off): the Perl version didn't let you turn CPU bars off. Useful when you want to focus only on memory, network, load, or disk and reduce clutter. + +* maxbarsperrow: wrap bars into multiple rows instead of one long row. Useful with many hosts so the window doesn't become impossibly wide; you get a grid and can still scan everything. + +* maxwidth: cap on window width in pixels (default 1900). Stops the window growing unbounded with many hosts; use together with maxbarsperrow for a predictable layout. + +* Startup visibility flags: --showmem, --shownet, --showload, --extended, --cpumode, --diskmode (and friends) let you start with the bars you care about already on. Useful so you don't have to press 2, 3, 4, 5 every time. + +* Window title (--title): set the SDL window title. Useful when you run several Loadbars windows (e.g. one per cluster or environment) and need to tell them apart in your taskbar or window list. + +* SSH options (--sshopts): pass extra flags to ssh (e.g. ConnectTimeout, ProxyJump). Useful on locked-down or jump-host setups so Loadbars works without changing your global SSH config for a one-off session. + +* hasagent: skip extra SSH agent checks when you know the key is already loaded. Useful to avoid startup delay or warnings when you've already run ssh-add and are monitoring many hosts. + +* Config file covers every option: any flag from --help can be set in ~/.loadbarsrc (no leading --). Perl had a config but the Go version supports the full set. Useful for reproducible setups and sharing. + +* Positional host arguments: you can run `loadbars server1 server2` without --hosts. Convenience when you only have a few hosts. + +* macOS as client: run the Loadbars binary on a Mac and connect to Linux servers via SSH. The Perl version was Linux-only. Useful to watch production from a laptop without a Linux VM or second machine. + +* Single static binary: no Perl runtime, no SDL Perl modules, no CPAN. Useful for deployment — copy one file to a jump host or new machine and run it. + +* Unit tests: mage test (or go test). The Go version has proper tests; useful for development and catching regressions. + +* Window resize (arrow keys): resize the window with the keyboard (left/right = width, up/down = height). Useful to fit more or fewer bars on screen without touching the mouse. (The Perl version had mouse-based resize; Go uses arrow keys.) + +* Hundreds of hosts in parallel: the Go implementation connects to all hosts concurrently and keeps polling without blocking. The Perl version struggled with many hosts. Useful for large fleets; you get a real "wall of bars" instead of a subset. + +## Core features + +### Load average bars + +Press `4` or `l` to toggle. Each host gets a bar: teal fill (1-min load), yellow 1px line (5-min), white 1px line (15-min). Scale: auto (floor 2.0) or fixed with `--loadmax N`. Press `r` to reset auto-scale. + +### Disk I/O bars + +Press `5` to toggle: aggregate (all whole-disk devices per host) → per-device → off. Partitions, loop, ram, zram, and device-mapper are excluded. Purple fill from top = read, darker purple from bottom = write. Extended mode (`e`) adds a 3px disk-utilization line. Config: `diskmode`, `diskmax`, `diskaverage`. `b`/`x` change disk average samples. + +### Global reference lines and options + +`g`: global average CPU line (1px red). `i`: global I/O average line (1px pink). `s`: host separator lines (1px red). Other options: `--maxbarsperrow N`, `--title`, `--sshopts`, `--hasagent`. Hotkeys `m`/`n` mirror `2`/`3` for memory and network. Hover over a bar for a tooltip with exact values and host highlight. + +### CPU monitoring + +CPU usage as vertical stacked bars: System (blue), User (yellow), Nice (green), GuestNice (lime green), Idle (black), IOwait (purple), IRQ/SoftIRQ (white), Guest/Steal (red). Press `1` for aggregate vs. per-core. Press `e` for extended mode (1px peak line: max system+user over last N samples). + +### Memory and network + +* `2` / `m`: memory — left half RAM (dark grey/black), right half Swap (grey/black) per host +* `3` / `n`: network — RX (top, light green) and TX (bottom) summed over non-loopback interfaces. Red bar = no non-lo interface. Use `--netlink` or `f`/`v` for link speed (utilization %). Default `gbit`. + +### All hotkeys + +``` +Key Action +───── ────────────────────────────────────────────────── +1 Toggle CPU (aggregate / per-core / off) +2 / m Toggle memory bars +3 / n Toggle network bars +4 / l Toggle load average bars +5 Toggle disk I/O (aggregate / per-device / off) +r Reset load and disk auto-scale peaks +e Toggle extended (peak line on CPU; disk util line) +g Toggle global average CPU line +i Toggle global I/O average line +s Toggle host separator lines +h Print hotkey list to stdout +q Quit +w Write current settings to ~/.loadbarsrc +a / y CPU average samples up / down +d / c Net average samples up / down +b / x Disk average samples up / down +f / v Link scale up / down +Arrows Resize window +``` + +### SSH and config + +Connect with public key auth; hosts need bash and `/proc` (Linux). No agent needed on the remote side. + +``` +loadbars --hosts server1,server2,server3 +loadbars --hosts root@server1,root@server2 +loadbars servername{01..50}.example.com --showcores 1 +loadbars --cluster production +``` + +Config: `~/.loadbarsrc` (key=value, no `--`; use `#` for comments). Any `--help` option. Press `w` to save current settings. + +### Building and platforms + +Go 1.25+ and SDL2. Install SDL2 (e.g. `sudo dnf install SDL2-devel` on Fedora, `brew install sdl2` on macOS), then: + +``` +mage build +./loadbars --hosts localhost +mage install # to ~/go/bin +mage test +``` + +Tested on Fedora Linux 43 and common distros; macOS as client to remote Linux only (no local macOS monitoring — no `/proc`). + +E-Mail your comments to `paul@nospam.buetow.org` :-) + +Other related posts: + +[2026-02-29 Loadbars 0.13.0 released (You are currently reading this)](./2026-02-29-loadbars-0.13.0-released.md) +[2025-11-02 Perl New Features and Foostats](./2025-11-02-perl-new-features-and-foostats.md) +[2025-09-14 Bash Golf Part 4](./2025-09-14-bash-golf-part-4.md) +[2025-03-05 Sharing on Social Media with Gos v1.0.0](./2025-03-05-sharing-on-social-media-with-gos.md) +[2024-03-03 A fine Fyne Android app for quickly logging ideas programmed in Go](./2024-03-03-a-fine-fyne-android-app-for-quickly-logging-ideas-programmed-in-golang.md) +[2023-12-10 Bash Golf Part 3](./2023-12-10-bash-golf-part-3.md) +[2023-06-01 KISS server monitoring with Gogios](./2023-06-01-kiss-server-monitoring-with-gogios.md) +[2022-05-27 Perl is still a great choice](./2022-05-27-perl-is-still-a-great-choice.md) +[2022-01-01 Bash Golf Part 2](./2022-01-01-bash-golf-part-2.md) +[2021-11-29 Bash Golf Part 1](./2021-11-29-bash-golf-part-1.md) +[2011-05-07 Perl Daemon (Service Framework)](./2011-05-07-perl-daemon-service-framework.md) +[2008-06-26 Perl Poetry](./2008-06-26-perl-poetry.md) + +[Back to the main site](../) diff --git a/gemfeed/index.md b/gemfeed/index.md index 862b0110..0bdbe602 100644 --- a/gemfeed/index.md +++ b/gemfeed/index.md @@ -3,8 +3,8 @@ ## To be in the .zone! [2026-03-01 - Site Reliability Engineering - Part 5: System Design, Incidents, and Learning](./2026-03-01-site-reliability-engineering-part-5.md) +[2026-02-29 - Loadbars 0.13.0 released](./2026-02-29-loadbars-0.13.0-released.md) [2026-02-22 - My desk rack: DeskPi RackMate T0](./2026-02-22-my-desk-rack.md) -[2026-02-15 - Loadbars resurrected: From Perl to Go after 15 years](./2026-02-15-loadbars-resurrected-from-perl-to-go.md) [2026-02-02 - A tmux popup editor for Cursor Agent CLI prompts](./2026-02-02-tmux-popup-editor-for-cursor-agent-prompts.md) [2026-01-01 - Using Supernote Nomad offline](./2026-01-01-using-supernote-nomad-offline.md) [2026-01-01 - Posts from July to December 2025](./2026-01-01-posts-from-july-to-december-2025.md) diff --git a/gemfeed/loadbars-resurrected-from-perl-to-go/loadbars.gif b/gemfeed/loadbars-0.13.0-released/loadbars.gif Binary files differindex b012e48b..b012e48b 100644 --- a/gemfeed/loadbars-resurrected-from-perl-to-go/loadbars.gif +++ b/gemfeed/loadbars-0.13.0-released/loadbars.gif @@ -31,8 +31,8 @@ Everything you read on this site is my personal opinion and experience. You can ### Posts [2026-03-01 - Site Reliability Engineering - Part 5: System Design, Incidents, and Learning](./gemfeed/2026-03-01-site-reliability-engineering-part-5.md) +[2026-02-29 - Loadbars 0.13.0 released](./gemfeed/2026-02-29-loadbars-0.13.0-released.md) [2026-02-22 - My desk rack: DeskPi RackMate T0](./gemfeed/2026-02-22-my-desk-rack.md) -[2026-02-15 - Loadbars resurrected: From Perl to Go after 15 years](./gemfeed/2026-02-15-loadbars-resurrected-from-perl-to-go.md) [2026-02-02 - A tmux popup editor for Cursor Agent CLI prompts](./gemfeed/2026-02-02-tmux-popup-editor-for-cursor-agent-prompts.md) [2026-01-01 - Using Supernote Nomad offline](./gemfeed/2026-01-01-using-supernote-nomad-offline.md) [2026-01-01 - Posts from July to December 2025](./gemfeed/2026-01-01-posts-from-july-to-december-2025.md) |
