diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-13 20:48:13 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-13 20:48:13 +0200 |
| commit | bd095a1b9a2027a1ff43fe4b6fa04d0354ca062c (patch) | |
| tree | ed4c8fad86c1b8347cc86020e0793822ae76a788 | |
| parent | 20e3db5bcb04bc57377432126404b5e99d0b0a92 (diff) | |
Convert POD documentation to Markdown and migrate to Justfile
- Convert all POD files to Markdown format
- Replace Makefile with justfile for build automation
- Remove deprecated Debian packaging files and related directories
- Update copyright year from 2013 to 2026 in Constants.pm and loadbars
- Remove obsolete docs directory (bugs, wishlist, and generated files)
- Fix sum() function in Utils.pm to handle undef values properly
| -rw-r--r-- | CLAUDE.md | 127 | ||||
| -rw-r--r-- | Makefile | 48 | ||||
| -rw-r--r-- | README.md | 126 | ||||
| -rw-r--r-- | README.txt | 100 | ||||
| -rw-r--r-- | debian/README | 7 | ||||
| -rw-r--r-- | debian/changelog | 290 | ||||
| -rw-r--r-- | debian/compat | 1 | ||||
| -rw-r--r-- | debian/control | 15 | ||||
| -rw-r--r-- | debian/copyright | 30 | ||||
| -rw-r--r-- | debian/files | 1 | ||||
| -rw-r--r-- | debian/loadbars.debhelper.log | 45 | ||||
| -rw-r--r-- | debian/loadbars.manpages | 1 | ||||
| -rw-r--r-- | debian/loadbars.substvars | 2 | ||||
| -rwxr-xr-x | debian/rules | 13 | ||||
| -rw-r--r-- | debian/source/format | 1 | ||||
| -rw-r--r-- | docs/bugs | 1 | ||||
| -rw-r--r-- | docs/loadbars.1 | 214 | ||||
| -rw-r--r-- | docs/loadbars.pod | 100 | ||||
| -rw-r--r-- | docs/loadbars.txt | 100 | ||||
| -rw-r--r-- | docs/wishlist | 12 | ||||
| -rw-r--r-- | justfile | 61 | ||||
| -rw-r--r-- | lib/Loadbars/Constants.pm | 2 | ||||
| -rw-r--r-- | lib/Loadbars/Main.pm | 8 | ||||
| -rw-r--r-- | lib/Loadbars/Utils.pm | 2 | ||||
| -rwxr-xr-x | loadbars | 2 |
25 files changed, 322 insertions, 987 deletions
diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..a9f26e0 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,127 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +Loadbars is a Perl-based real-time server load monitoring tool that connects to multiple remote servers via SSH and visualizes CPU, memory, and network statistics using SDL graphics. It uses threading to monitor multiple hosts concurrently and displays the data in a graphical window. + +**Technology Stack:** +- Perl 5.14+ +- SDL (Simple DirectMedia Layer) via libsdl-perl for graphics +- Threading for concurrent server monitoring +- SSH for remote connections (requires public/private key authentication) + +## Build and Development Commands + +**Version management:** +```bash +make version # Extract version from debian/changelog to .version file +``` + +**Code formatting:** +```bash +make perltidy # Format all Perl code using perltidy +``` + +**Documentation generation:** +```bash +make documentation # Generate man pages and text docs from POD +``` + +**Full release process:** +```bash +make release # Generate docs, tag, and push to git +``` + +**Testing the application:** +```bash +# Run locally +./loadbars --hosts localhost + +# Run with multiple hosts +./loadbars --hosts localhost,server1.example.com --showcores 1 + +# Profile with NYTProf +make profile # Runs loadbars with profiling and generates HTML report +``` + +**Installation:** +```bash +make install DESTDIR=/path/to/install # Install to custom directory +``` + +## Architecture + +### Module Structure + +The codebase follows a modular Perl architecture with all core logic in `lib/Loadbars/`: + +- **Main.pm** (~900 lines): Core application logic + - SDL window management and rendering + - CPU/memory/network parsing from `/proc/stat`, `/proc/meminfo`, `/sys/class/net` + - Thread creation and management for remote SSH connections + - Main event loop and keyboard handling + - Drawing functions for bars, text, and statistics + +- **Config.pm**: Configuration file handling + - Reads from `~/.loadbarsrc` + - Supports ClusterSSH integration via `/etc/clusters` + - Recursive cluster expansion with cycle detection + +- **HelpDispatch.pm**: Command-line argument parsing and help system + - Creates GetOptions dispatch table + - Generates usage information + +- **Constants.pm**: Application constants + - Color definitions for SDL + - Timing intervals (CPU: 0.14s, Network: 3.0s, Memory: 1.0s) + - Configuration file paths + +- **Shared.pm**: Shared state variables used across modules + - Global configuration hash `%C` + - Internal state hash `%I` + - Thread PID tracking `%PIDS` + +- **Utils.pm**: Utility functions for string manipulation and helpers + +### Entry Point Flow + +1. `loadbars` script parses command-line arguments +2. Loads configuration from `~/.loadbarsrc` if exists +3. Resolves cluster definitions from `/etc/clusters` if using `--cluster` +4. Creates one thread per host for SSH connections +5. Each thread runs `vmstat` remotely and pipes data back +6. Main loop reads thread data, parses statistics, and renders SDL graphics +7. Handles keyboard input for interactive controls (toggle cores, extended mode, etc.) + +### Library Path Resolution + +The main script checks for `./lib/Loadbars` first (development mode), then falls back to `/usr/share/loadbars/lib` (installed mode). This allows running from source tree or installed location. + +### Threading Model + +Each monitored host gets its own Perl thread that: +- Establishes SSH connection +- Runs `vmstat` and other commands remotely +- Pipes output back to shared data structures +- Main thread reads shared data and updates display + +### Key Design Patterns + +- **Shared state**: Uses `threads::shared` for communication between threads +- **SDL rendering**: Double-buffered rendering with fixed intervals +- **Parser design**: CPU/memory/network stats parsed from `/proc` filesystem format +- **Color coding**: Different colors represent different metrics (system=blue, user=yellow, iowait=purple, etc.) + +## Important Implementation Details + +**Version source**: The `.version` file is generated from the VERSION variable in the Makefile using the `make version` target. Version is displayed at startup and in man pages. + +**Font handling**: Custom fonts are stored in `fonts/` directory and installed to `/usr/share/loadbars/fonts`. + +**Configuration persistence**: Pressing 'w' during execution writes current settings to `~/.loadbarsrc`. + +**SSH requirements**: Requires SSH agent or passwordless SSH keys for remote connections. The tool automatically runs `ssh-add` if no agent is detected. + +**Remote data collection**: Uses `vmstat`, `/proc/stat`, `/proc/meminfo`, and `/sys/class/net` on remote hosts via SSH. diff --git a/Makefile b/Makefile deleted file mode 100644 index 2bb2ba2..0000000 --- a/Makefile +++ /dev/null @@ -1,48 +0,0 @@ -NAME=loadbars -all: version documentation perltidy -version: - cut -d' ' -f2 debian/changelog | head -n 1 | sed 's/(//;s/)//' > .version -profile: - perl -d:NYTProf loadbars --hosts localhost - nytprofhtml nytprof.out -perltidy: - find . -name \*.pm | xargs perltidy -b - perltidy -b $(NAME) - find . -name \*.bak -delete -documentation: - pod2man --release="$(NAME) $$(cat .version)" \ - --center="User Commands" ./docs/$(NAME).pod > ./docs/$(NAME).1 - pod2text ./docs/$(NAME).pod > ./docs/$(NAME).txt - # For github page - cp ./docs/$(NAME).pod README.pod -install: - test ! -d $(DESTDIR)/usr/bin && mkdir -p $(DESTDIR)/usr/bin || exit 0 - test ! -d $(DESTDIR)/usr/share/$(NAME) && mkdir -p $(DESTDIR)/usr/share/$(NAME) || exit 0 - cp $(NAME) $(DESTDIR)/usr/bin - cp -r ./lib $(DESTDIR)/usr/share/$(NAME)/lib - cp -r ./fonts $(DESTDIR)/usr/share/$(NAME)/fonts - cp ./.version $(DESTDIR)/usr/share/$(NAME)/version -deinstall: - test ! -z "$(DESTDIR)" && test -f $(DESTDIR)/usr/bin/$(NAME) && rm $(DESTDIR)/usr/bin/$(NAME) || exit 0 - test ! -z "$(DESTDIR)/usr/share/$(NAME)" && -d $(DESTDIR)/usr/share/$(NAME) && rm -r $(DESTDIR)/usr/share/$(NAME) || exit 0 -dch: - dch -i -deb: version - dpkg-buildpackage -cleanall: clean-top - test -f nytprof.out && rm nytprof.out - test -f tmon.out && rm tmon.out - test -d nytprof && rm -Rf nytprof -release: dch deb version documentation perltidy dput - git commit -a -m 'New release' - bash -c "git tag $$(cat .version)" - git push --tags - git push origin master -clean-top: - rm ../$(NAME)_*.tar.gz - rm ../$(NAME)_*.dsc - rm ../$(NAME)_*.changes - rm ../$(NAME)_*.deb -dput: - dput -u wheezy-buetowdotorg ../$(NAME)_$$(cat ./.version)_amd64.changes - dput -u jessie-buetowdotorg ../$(NAME)_$$(cat ./.version)_amd64.changes diff --git a/README.md b/README.md new file mode 100644 index 0000000..f5aa291 --- /dev/null +++ b/README.md @@ -0,0 +1,126 @@ +# loadbars - A small and humble tool to observe server loads + +## Synopsis + +``` +loadbars [LIST OF HOSTNAMES] [OPTIONS] +``` + +### Tested platforms + +This version of loadbars has been tested on Fedora Linux 43 and should work on +most modern Linux distributions (RHEL, CentOS, Ubuntu, Debian, etc.). + +### I like flying elephants + +For any startup params help check out `--help` on command line or `h` during program +execution. + +### A few examples however + +```bash +loadbars --extended 1 --showcores 1 --height 300 --hosts localhost + +loadbars --hosts localhost,server1.example.com,server2.example.com + +loadbars --cluster foocluster (foocluster is in /etc/clusters [ClusterSSH]) +``` + +### More examples, using shell expansion + +```bash +loadbars servername{01,02,03}.example.com + +loadbars servername{01..50}.example.com --showcores 1 +``` + +## Description + +Loadbars is a small script that can be used to observe CPU loads of several remote servers at once in real time. It connects with SSH (using SSH public/private key auth) to several servers at once and vizualizes all server CPUs and memory statistics right next each other (either summarized or each core separately). Loadbars is not a tool for collecting CPU loads and drawing graphs for later analysis. However, since such tools require a significant amount of time before producing results, Loadbars lets you observe the current state immediately. Loadbars does not remember or record any load information. It just shows the current CPU usages like top or vmstat does. + +## Installation + +### Dependencies (Fedora/RHEL/CentOS) + +To run loadbars on Fedora Linux, you need to install the following packages: + +```bash +sudo dnf install perl perl-SDL perl-Alien-SDL perl-Proc-ProcessTable +``` + +### Dependencies for Remote Hosts + +For monitoring remote servers via SSH, the remote hosts need: + +```bash +sudo dnf install perl-Time-HiRes +``` + +### Running from Source + +To run loadbars directly from the source directory: + +```bash +./loadbars --hosts localhost +``` + +Or with remote servers: + +```bash +./loadbars --hosts root@server1,root@server2 --showcores 1 +``` + +### SSH Configuration + +Loadbars requires SSH public/private key authentication. Make sure: + +- You have SSH keys set up (~/.ssh/id_rsa or similar) +- Your public key is in ~/.ssh/authorized_keys on remote servers +- SSH agent is running (ssh-agent), or passwordless keys are configured + +## Info + +### CPU stuff + +- `st` = Steal in % [see man proc] (extended), Color: Red +- `gt` = Guest in % [see man proc] (extended), Color: Red +- `sr` = Soft IRQ usage in % (extended), Color: White +- `ir` = IRQ usage in % (extended), Color: White +- `io` = IOwait cpu sage in %, Color: Purple +- `id` = Idle cpu usage in % (extended), Color: Black +- `ni` = Nice cpu usage in %, Color: Green +- `us` = User cpu usage in %, Color: Yellow, dark yellow if to>50%, orange if to>50% +- `sy` = System cpu sage in %, Color: Blue, lighter blue if >30% +- `to` = Total CPU usage, which is (100% - id) +- `pk` = Max us+sy peak of last avg. samples (extended) +- 1px horizontal line: Maximum sy+us+io of last 'avg' samples (extended) + +### Memory stuff + +- `Ram` = System ram usage in %, Color: Dark grey +- `Swp` = System swap usage in %, Color: Grey + +### Network stuff + +- `Rxb` = Incoming (received) traffic in %, Color: Light green, normal green if >100% while using low netlink reference. Bar comes from top and is half width. +- `Txb` = Outgoing (transmitted) traffic in %, Color: Light green, normal green if >100% while using low netlink reference. Bar comes from bottom and is half width. + +When network bar is red: The interface does not exist on the specific remote host. + +#### Config file support + +Loadbars tries to read ~/.loadbarsrc and it's possible to configure any option you find in --help but without leading '--'. For comments just use the '#' sign. Sample config: + +``` +showcores=1 # Always show cores on startup +``` + +will always show all CPU cores. If you press the 'w' hotkey during program execution your config file will be overwritten using the current settings. + +## License + +See package description or project website. + +## Author + +Paul Buetow - <http://buetow.org> diff --git a/README.txt b/README.txt deleted file mode 100644 index a3ac6a2..0000000 --- a/README.txt +++ /dev/null @@ -1,100 +0,0 @@ -NAME - loadbars - A small and humble tool to observe server loads - -SYNOPSIS - loadbars [LIST OF HOSTNAMES] [OPTIONS] - - Tested platforms - This version of loadbars has only been tested on Debian GNU/Linux - Wheezy. - - I like flying elephants - For any startup params help check out --help on command line or 'h' - during program execution. - - A few examples however - loadbars --extended 1 --showcores 1 --height 300 --hosts localhost - - loadbars --hosts localhost,server1.example.com,server2.example.com - - loadbars --cluster foocluster (foocluster is in /etc/clusters - [ClusterSSH]) - - More examples, using shell expansion - loadbars servername{01,02,03}.example.com - - loadbars servername{01..50}.example.com --showcores 1 - -DESCRIPTION - Loadbars is a small script that can be used to observe CPU loads of - several remote servers at once in real time. It connects with SSH (using - SSH public/private key auth) to several servers at once and vizualizes - all server CPUs and memory statistics right next each other (either - summarized or each core separately). Loadbars is not a tool for - collecting CPU loads and drawing graphs for later analysis. However, - since such tools require a significant amount of time before producing - results, Loadbars lets you observe the current state immediately. - Loadbars does not remember or record any load information. It just shows - the current CPU usages like top or vmstat does. - -INFO - CPU stuff - st = Steal in % [see man proc] (extended), Color: Red - - gt = Guest in % [see man proc] (extended), Color: Red - - sr = Soft IRQ usage in % (extended), Color: White - - ir = IRQ usage in % (extended), Color: White - - io = IOwait cpu sage in %, Color: Purple - - id = Idle cpu usage in % (extended), Color: Black - - ni = Nice cpu usage in %, Color: Green - - us = User cpu usage in %, Color: Yellow, dark yellow if to>50%, orange - if to>50% - - sy = System cpu sage in %, Color: Blue, lighter blue if >30% - - to = Total CPU usage, which is (100% - id) - - pk = Max us+sy peak of last avg. samples (extended) - - 1px horizontal line: Maximum sy+us+io of last 'avg' samples (extended) - - Memory stuff - Ram: System ram usage in %, Color: Dark grey - - Swp: System swap usage in %, Color: Grey - - Network stuff - Rxb: Incoming (received) traffic in %, Color: Light green, normal green - if >100% while using low netlink reference. Bar comes from top and is - half width. - - Txb: Outgoing (transmitted) traffic in %, Color: Light green, normal - green if >100% while using low netlink reference. Bar comes from bottom - and is half width. - - When network bar is red: The interface does not exist on the specific - remote host. - - Config file support - Loadbars tries to read ~/.loadbarsrc and it's possible to configure any - option you find in --help but without leading '--'. For comments just - use the '#' sign. Sample config: - - showcores=1 # Always show cores on startup - - will always show all CPU cores. If you press the 'w' hotkey during - program execution your config file will be overwritten using the current - settings. - -LICENSE - See package description or project website. - -AUTHOR - Paul Buetow - <http://buetow.org> - diff --git a/debian/README b/debian/README deleted file mode 100644 index 2279588..0000000 --- a/debian/README +++ /dev/null @@ -1,7 +0,0 @@ -The Debian Package loadbars ----------------------------- - -This is just a hobby project. Not sure if everything meets the debian -policy though. - - -- Paul Buetow <paul@buetow.org> Sun, 08 Apr 2012 15:23:53 +0200 diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index 5eafb5f..0000000 --- a/debian/changelog +++ /dev/null @@ -1,290 +0,0 @@ -loadbars (0.7.5) stable; urgency=low - - * Remove README.md - - -- Paul Buetow <paul@buetow.org> Sun, 22 Jun 2014 11:42:04 +0200 - -loadbars (0.7.4) stable; urgency=low - - * Now really add README.pod - - -- Paul Buetow <paul@buetow.org> Sun, 22 Jun 2014 11:41:16 +0200 - -loadbars (0.7.3) stable; urgency=low - - * Update README.pod for Github page - - -- Paul Buetow <paul@buetow.org> Sun, 22 Jun 2014 11:39:47 +0200 - -loadbars (0.7.2) stable; urgency=low - - * Add Debian Jessie Package - - -- Paul Buetow <paul@buetow.org> Sat, 14 Jun 2014 11:05:34 +0200 - -loadbars (0.7.1) stable; urgency=low - - * It's now possible to resize the window via mouse - - -- Paul Buetow <paul@buetow.org> Wed, 10 Jul 2013 23:53:24 +0200 - -loadbars (0.7.0) stable; urgency=low - - * Initial version for Debian GNU/Linux Wheezy - - * Has only been tested on Wheezy - - * Major code cleanup. Removed the text display stuff from the code. - - * Minor performance enhancements - - * It is now possible to specify a list of hosts using shell espansion. - - E.g.: loadbars server{01,10..20}.example.com [OPTIONS] - - -- Paul Buetow <paul@buetow.org> Wed, 19 Jun 2013 19:25:57 +0200 - -loadbars (0.6.0.99) precise; urgency=low - - * New dev branch - - -- Paul Buetow <pb@venus> Thu, 26 Jul 2012 08:24:11 +0200 - -loadbars (0.6.0.5) stable; urgency=low - - * Introducing network stats. Network stats toggle button is 3 - The new --netint INTNAME startup param specifies the nic to observe. - The new --hasnet 0|1 startup params specifies whether to display network - stats on startup. - The new --netlink SPEED startup params specifies the network interface - speed to assume on startup on the given nic. Possible values are mbit, - 10mbit, 100mbit, gbit, 10gbit or just a number which is interpreted as - mbytes/s. If no --netlink param is given the standard NIC speed is set to - 1gbit. - - * Incoming network traffic is displayed from a bar coming from upside down - (light green). 100% means: The theoretical network bandwidth is used - 100%. - - * Outgoing network traffic is displayed from a bar coming from downside up - (light green). 100% means: The theoretical network bandwidth is used - 100%. - - * Rxb means: Received bytes in % until total bandwidth - - * Txb means: Transmitted bytes in % until total bandwidth - - * During runtime the v hotkey decrease the link speed by factor 10 - - * During runtime the f hotkey increases the link speed by factor 10 - - * During runtime the n hotkey switches to the next available network - interface. If you have hosts with different nics and try to switch to a - nic wich is available on one host but not on another a *big red* bar will - be shown on the host which is missing the specific nic. - - * Memory stats toggle button is now 2 instead of m. If you press m a - deprecation massage is shown and nothing more happens. - - * Some code optimizations on CPU bars. It should consume *at least a little* - less CPU on the display host than before. BUT NOT *much less*! - - * New manual page (removed some infos from --help and put it into the - manpage). - - * Removed the --factor switch, since it was barely used and caused some - implementation details on network and memory stats. Maybe I am just too - studpid. - - * Improved the info messages displayed on stdout. - - * The remote code (fetching infos from /proc fs) is now written in perl and - not bash anymore. Sooner or later this will be used to put more logic into - it (e.g. setting uptime intervals separately for differend kinds of stats). - - * Re-add the --title startup params which specifies the window title of the - loadbars session. - - * Some code refactoring. - - * New wishlist brainstorming for next released (see docs/wishlist). - - -- Paul Buetow <paul@buetow.org> Mon, 23 Jul 2012 18:40:39 +0200 - -loadbars (0.5.3) stable; urgency=low - - * Introduce new param --hasagent. With --hasagent 1 loadbars will not - run 'ssh-add' which would ask for your SSH key password to add it to - the ssh agent. With --hasagent 0 (default value) loadbars will run - 'ssh-add' on startup in order to add your SSH key to the SSH agent. - - * Add openssh-client dependency to the .deb package. - - * Some code bugfixing. - - -- Paul Buetow <paul@buetow.org> Tue, 01 May 2012 11:57:27 +0200 - -loadbars (0.5.2.2) stable; urgency=low - - * Test release, to test the deb.buetow.org repo key sign stuff. - - -- Paul Buetow <paul@buetow.org> Sun, 08 Apr 2012 15:23:53 +0200 - -loadbars (0.5.2.1) stable; urgency=low - - * Hotfix release, contains only a corrected version string. - - -- Paul Buetow <paul@buetow.org> Sun, 08 Apr 2012 15:23:53 +0200 - -loadbars (0.5.2) stable; urgency=low - - * Initial .deb - - * Heavy code refactoring (more modular code) - - -- Paul Buetow <paul@buetow.org> Sun, 08 Apr 2012 15:23:53 +0200 - -loadbars (0.0.0) stable; urgency=low - - * ALL CHANGES FOR PREVIOUS VERSIONS (NON DEBIAN PACKAGE) - - Thu Apr 19 21:41:52 CEST 2012 - * Minor change, sleep 0.5s instead of 3s if ssh command fails - - Fri Apr 6 10:17:30 CEST 2012 - * Minor fixes such as redraw background on toggle text display which - should fix some weird display bugs. - - Fri Mar 16 07:20:50 CET 2012 - * Release v0.5.1.1 - * Dropped FreeBSD support / focus is Linux - * On shutdown all sub-processes are gonna be terminated instantly - (was old bug). Needs Proc::ProcessTable module. - * Dont quit loadbars if ~/.loadbarsrc can not be overwritten - - Sat Feb 25 20:09:02 CET 2012 - * Release v0.5.1 - * Add config file support (~/.loadbarsrc) and it's possible to configure - any option you find in --help but without leading '--'. For comments - just use the '#' sign. Sample config: - showcores=1 # Always show cores on startup - showtext=0 # Always don't display text on startup - * Add hotkey 'w' which writes current settings to the configfile - * Remove --title option (no need anyway) - * Some code cleanups - * Some bugfixes - - Sat Feb 4 10:56:27 CET 2012 - * Release v0.5.0 - * Add stats for rudimentary memory and swap usage (--showmem option or m hotkey) - * Remove --width and --inter options - * Add --barwidth option, each bar is barwidth pixels now - * Add --maxwidth option, which represents the max total window width - * Auto disable text display if text does not fit into window (maxwidth) pixels - * Auto re-enable text display if text does fit again into window - * Key right increases window width by 100px and left decreases by 100px - * Key down increases window height by 100px and up decreases by 100px - * Set 'samples' default values from 1000 down to 500. - * Displays a text warning on stdout if computer may be too slow - * No sporadic crashes on shutdown anymore - * Some internal tweaks, no separate event thread needed anymore. This fixes - some sporadic bugs. - - Sun Jan 21 14:16:37 CET 2012 - * Released v0.4.0 - * Also show stats for idle, iowait, irq, softirq, steal and guest cpu time - * Some parameters have been renamed (see --help) - * Introduced extended mode (use --extended 1 at startup or 'e' hotkey) - * Modified the bar colors a little bit (see --help) - * Some Bugfixes - - Tue Dec 27 12:28:40 CET 2011 - * Released v0.3.1 - * --cluster option (which reads the ClusterSSH config file /etc/clusters/) - also supports clusters of clusters. e.g.: - $ cat /etc/clusters - clusterA server01 server02 - clusterB clusterA server03 - So --cluster clusterB will connect to server01 server02 and server03 - * --hosts option supports username to be specified. E.g.: - # ./loadbars --hosts user1@server01,user2@server02 - will connect to server01 using user1 and server02 with user2. - - Mon Dec 26 14:46:25 CET 2011 - * Released v0.3.0 - * Peak CPU load is not displayed by default anymore. User 'p' command or - the --togglepeak 1 startup option. - * Peak CPU load is now also displayd in text format (marked as pk) - * New option --cluster which brings rudimentary ClusterSSH config file - support. E.g. './loadbars --cluster server' reads cluster server from - the /etc/clusters file. - - Sat Nov 19 11:54:51 CET 2011 - * Released v0.2.2 - * Added a 1px horizontal line to each bar which represent the max. peak - of user and system cpu load of the last N samples (max. of the last 15 - samples by default, it can be configured using --average) - * Default value for --average has been decreased from 30 to 15 sample - values - - Fr 12. Aug 21:41:46 CEST 2011 - * Released v0.2.1 - - Di 9. Aug 20:42:43 CEST 2011 - * Released v0.2.0.2 (Bugfixes only; Bar width was wrong by 1px) - - So 7. Aug 15:53:08 CEST 2011 - * Added grey separator lines between each hosts during CPU toggle mode - * More intelligent CPU core numbering during CPU toggle mode - * FreeBSD server support for CPU graphs has been tested and is working using - linprocfs mounted on /compat/linux/proc. - * Changed licence to GPL 2 - * Some more documentation - * Some minor bugfixes - - So 7. Aug 14:06:45 CEST 2011 - * Released v0.2.0.1 (Bugfixes only) - - Sa 6. Aug 22:04:15 CEST 2011 - * Released v0.2.0 (new major version) - * No interactive CLI shell anymore but instead hotkeys for the - SDL interface (press h and see). - * Bugfixes (E.g. Loadbars does not hang anymore after typing commands) - * Major code refactoring - - Fr 5. Aug 23:52:49 CEST 2011 - * Released v0.1.3.1 - * Some more minor bugfixes - - Fr 5. Aug 23:29:19 CEST 2011 - * Released v0.1.3 - * Fixed a segfault bug on SDL::Font using threads - * Added an advanced help option (h vs. H) - * Added new toggle option: Displaying bar number vs. hostname - * Some little code refactoring - - Fr 22. Apr 13:08:08 CEST 2011 - * Released v0.1.2.1 - - Mi 20. Apr 08:37:49 CEST 2011 - * Added ./BUGS which includes a summary of all current known bugs - - Fri Jan 14 23:03:47 CET 2011 - * Released v0.1.2 - * Added 'toggle summary' option - * Removed all old screenshots - * Added a newer one - * Fixed lots of bugs (including segfaults) - * Cosmetic code fixes - - Tue Jan 11 14:01:32 CET 2011 - * Released v0.1.1 - * Extended help text ('h' command) - * Added CHANGELOG and README files - * Fixed a typo - - Tue Jan 11 13:??:?? CET 2011 - * Released v0.1.0 - * With initial font support (text display of the stats) - * Everything else which has been implemented up to 0.1-beta8-pre6 - -- Paul Buetow <paul@buetow.org> Sun, 08 Apr 2012 15:23:53 +0200 diff --git a/debian/compat b/debian/compat deleted file mode 100644 index 45a4fb7..0000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -8 diff --git a/debian/control b/debian/control deleted file mode 100644 index 1519378..0000000 --- a/debian/control +++ /dev/null @@ -1,15 +0,0 @@ -Source: loadbars -Section: utils -Priority: optional -Maintainer: Paul Buetow <paul@buetow.org> -Build-Depends: perl, perltidy -Standards-Version: 3.9.2 -Homepage: http://buetow.org -Vcs-Git: https://github.com/buetow/loadbars.git -Vcs-Browser: https://github.com/buetow/loadbars - -Package: loadbars -Architecture: all -Depends: ${perl:Depends}, libsdl-perl (>= 2.2.5-1), libproc-processtable-perl (>= 0.45-1), openssh-client -Description: Real time monitoring tool - Loadbars is a tool to observe loads of several remote servers at once. diff --git a/debian/copyright b/debian/copyright deleted file mode 100644 index 4685493..0000000 --- a/debian/copyright +++ /dev/null @@ -1,30 +0,0 @@ -Format: http://dep.debian.net/deps/dep5 -Upstream-Name: loadbars -Source: http://buetow.org - -Files: * -Copyright: 2012 Paul Buetow <paul@buetow.org> -License: GPL-3.0+ - -Files: debian/* -Copyright: 2012 Paul Buetow <paul@buetow.org> -License: GPL-3.0+ - -License: GPL-3.0+ - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - . - This package is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - . - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. - . - On Debian systems, the complete text of the GNU General - Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". - - diff --git a/debian/files b/debian/files deleted file mode 100644 index 61369bc..0000000 --- a/debian/files +++ /dev/null @@ -1 +0,0 @@ -loadbars_0.7.5_all.deb utils optional diff --git a/debian/loadbars.debhelper.log b/debian/loadbars.debhelper.log deleted file mode 100644 index 545a50f..0000000 --- a/debian/loadbars.debhelper.log +++ /dev/null @@ -1,45 +0,0 @@ -dh_auto_configure -dh_auto_build -dh_auto_test -dh_prep -dh_installdirs -dh_auto_install -dh_install -dh_installdocs -dh_installchangelogs -dh_installexamples -dh_installman -dh_installcatalogs -dh_installcron -dh_installdebconf -dh_installemacsen -dh_installifupdown -dh_installinfo -dh_pysupport -dh_installinit -dh_installmenu -dh_installmime -dh_installmodules -dh_installlogcheck -dh_installlogrotate -dh_installpam -dh_installppp -dh_installudev -dh_installwm -dh_installxfonts -dh_installgsettings -dh_bugfiles -dh_ucf -dh_lintian -dh_gconf -dh_icons -dh_perl -dh_usrlocal -dh_link -dh_compress -dh_fixperms -dh_installdeb -dh_gencontrol -dh_md5sums -dh_builddeb -dh_builddeb diff --git a/debian/loadbars.manpages b/debian/loadbars.manpages deleted file mode 100644 index a3155c7..0000000 --- a/debian/loadbars.manpages +++ /dev/null @@ -1 +0,0 @@ -docs/loadbars.1 diff --git a/debian/loadbars.substvars b/debian/loadbars.substvars deleted file mode 100644 index bcb0957..0000000 --- a/debian/loadbars.substvars +++ /dev/null @@ -1,2 +0,0 @@ -perl:Depends=perl -misc:Depends= diff --git a/debian/rules b/debian/rules deleted file mode 100755 index b760bee..0000000 --- a/debian/rules +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/make -f -# -*- makefile -*- -# Sample debian/rules that uses debhelper. -# This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a -# dh-make output file, you may use that output file without restriction. -# This special exception was added by Craig Small in version 0.37 of dh-make. - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 - -%: - dh $@ diff --git a/debian/source/format b/debian/source/format deleted file mode 100644 index 89ae9db..0000000 --- a/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (native) diff --git a/docs/bugs b/docs/bugs deleted file mode 100644 index e169314..0000000 --- a/docs/bugs +++ /dev/null @@ -1 +0,0 @@ -No known bugs there atm diff --git a/docs/loadbars.1 b/docs/loadbars.1 deleted file mode 100644 index 9317d90..0000000 --- a/docs/loadbars.1 +++ /dev/null @@ -1,214 +0,0 @@ -.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) -.\" -.\" Standard preamble: -.\" ======================================================================== -.de Sp \" Vertical space (when we can't use .PP) -.if t .sp .5v -.if n .sp -.. -.de Vb \" Begin verbatim text -.ft CW -.nf -.ne \\$1 -.. -.de Ve \" End verbatim text -.ft R -.fi -.. -.\" Set up some character translations and predefined strings. \*(-- will -.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left -.\" double quote, and \*(R" will give a right double quote. \*(C+ will -.\" give a nicer C++. Capital omega is used to do unbreakable dashes and -.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, -.\" nothing in troff, for use with C<>. -.tr \(*W- -.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' -.ie n \{\ -. ds -- \(*W- -. ds PI pi -. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch -. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch -. ds L" "" -. ds R" "" -. ds C` "" -. ds C' "" -'br\} -.el\{\ -. ds -- \|\(em\| -. ds PI \(*p -. ds L" `` -. ds R" '' -'br\} -.\" -.\" Escape single quotes in literal strings from groff's Unicode transform. -.ie \n(.g .ds Aq \(aq -.el .ds Aq ' -.\" -.\" If the F register is turned on, we'll generate index entries on stderr for -.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index -.\" entries marked with X<> in POD. Of course, you'll have to process the -.\" output yourself in some meaningful fashion. -.ie \nF \{\ -. de IX -. tm Index:\\$1\t\\n%\t"\\$2" -.. -. nr % 0 -. rr F -.\} -.el \{\ -. de IX -.. -.\} -.\" -.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). -.\" Fear. Run. Save yourself. No user-serviceable parts. -. \" fudge factors for nroff and troff -.if n \{\ -. ds #H 0 -. ds #V .8m -. ds #F .3m -. ds #[ \f1 -. ds #] \fP -.\} -.if t \{\ -. ds #H ((1u-(\\\\n(.fu%2u))*.13m) -. ds #V .6m -. ds #F 0 -. ds #[ \& -. ds #] \& -.\} -. \" simple accents for nroff and troff -.if n \{\ -. ds ' \& -. ds ` \& -. ds ^ \& -. ds , \& -. ds ~ ~ -. ds / -.\} -.if t \{\ -. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" -. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' -. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' -. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' -. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' -. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' -.\} -. \" troff and (daisy-wheel) nroff accents -.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' -.ds 8 \h'\*(#H'\(*b\h'-\*(#H' -.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] -.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' -.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' -.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] -.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] -.ds ae a\h'-(\w'a'u*4/10)'e -.ds Ae A\h'-(\w'A'u*4/10)'E -. \" corrections for vroff -.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' -.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' -. \" for low resolution devices (crt and lpr) -.if \n(.H>23 .if \n(.V>19 \ -\{\ -. ds : e -. ds 8 ss -. ds o a -. ds d- d\h'-1'\(ga -. ds D- D\h'-1'\(hy -. ds th \o'bp' -. ds Th \o'LP' -. ds ae ae -. ds Ae AE -.\} -.rm #[ #] #H #V #F C -.\" ======================================================================== -.\" -.IX Title "LOADBARS 1" -.TH LOADBARS 1 "2013-06-27" "loadbars 0.7.5" "User Commands" -.\" For nroff, turn off justification. Always turn off hyphenation; it makes -.\" way too many mistakes in technical documents. -.if n .ad l -.nh -.SH "NAME" -loadbars \- A small and humble tool to observe server loads -.SH "SYNOPSIS" -.IX Header "SYNOPSIS" -loadbars [\s-1LIST\s0 \s-1OF\s0 \s-1HOSTNAMES\s0] [\s-1OPTIONS\s0] -.SS "Tested platforms" -.IX Subsection "Tested platforms" -This version of loadbars has only been tested on Debian GNU/Linux Wheezy. -.SS "I like flying elephants" -.IX Subsection "I like flying elephants" -For any startup params help check out \-\-help on command line or 'h' during program -execution. -.SS "A few examples however" -.IX Subsection "A few examples however" -loadbars \-\-extended 1 \-\-showcores 1 \-\-height 300 \-\-hosts localhost -.PP -loadbars \-\-hosts localhost,server1.example.com,server2.example.com -.PP -loadbars \-\-cluster foocluster (foocluster is in /etc/clusters [ClusterSSH]) -.SS "More examples, using shell expansion" -.IX Subsection "More examples, using shell expansion" -loadbars servername{01,02,03}.example.com -.PP -loadbars servername{01..50}.example.com \-\-showcores 1 -.SH "DESCRIPTION" -.IX Header "DESCRIPTION" -Loadbars is a small script that can be used to observe \s-1CPU\s0 loads of several remote servers at once in real time. It connects with \s-1SSH\s0 (using \s-1SSH\s0 public/private key auth) to several servers at once and vizualizes all server CPUs and memory statistics right next each other (either summarized or each core separately). Loadbars is not a tool for collecting \s-1CPU\s0 loads and drawing graphs for later analysis. However, since such tools require a significant amount of time before producing results, Loadbars lets you observe the current state immediately. Loadbars does not remember or record any load information. It just shows the current \s-1CPU\s0 usages like top or vmstat does. -.SH "INFO" -.IX Header "INFO" -.SS "\s-1CPU\s0 stuff" -.IX Subsection "CPU stuff" -st = Steal in % [see man proc] (extended), Color: Red -.PP -gt = Guest in % [see man proc] (extended), Color: Red -.PP -sr = Soft \s-1IRQ\s0 usage in % (extended), Color: White -.PP -ir = \s-1IRQ\s0 usage in % (extended), Color: White -.PP -io = IOwait cpu sage in %, Color: Purple -.PP -id = Idle cpu usage in % (extended), Color: Black -.PP -ni = Nice cpu usage in %, Color: Green -.PP -us = User cpu usage in %, Color: Yellow, dark yellow if to>50%, orange if to>50% -.PP -sy = System cpu sage in %, Color: Blue, lighter blue if >30% -.PP -to = Total \s-1CPU\s0 usage, which is (100% \- id) -.PP -pk = Max us+sy peak of last avg. samples (extended) -.PP -1px horizontal line: Maximum sy+us+io of last 'avg' samples (extended) -.SS "Memory stuff" -.IX Subsection "Memory stuff" -Ram: System ram usage in %, Color: Dark grey -.PP -Swp: System swap usage in %, Color: Grey -.SS "Network stuff" -.IX Subsection "Network stuff" -Rxb: Incoming (received) traffic in %, Color: Light green, normal green if >100% while using low netlink reference. Bar comes from top and is half width. -.PP -Txb: Outgoing (transmitted) traffic in %, Color: Light green, normal green if >100% while using low netlink reference. Bar comes from bottom and is half width. -.PP -When network bar is red: The interface does not exist on the specific remote host. -.PP -\fIConfig file support\fR -.IX Subsection "Config file support" -.PP -Loadbars tries to read ~/.loadbarsrc and it's possible to configure any option you find in \-\-help but without leading '\-\-'. For comments just use the '#' sign. Sample config: -.Sp -.RS 4 -showcores=1 # Always show cores on startup -.RE -.PP -will always show all \s-1CPU\s0 cores. If you press the 'w' hotkey during program execution your config file will be overwritten using the current settings. -.SH "LICENSE" -.IX Header "LICENSE" -See package description or project website. -.SH "AUTHOR" -.IX Header "AUTHOR" -Paul Buetow \- <http://buetow.org> diff --git a/docs/loadbars.pod b/docs/loadbars.pod deleted file mode 100644 index 4a652f4..0000000 --- a/docs/loadbars.pod +++ /dev/null @@ -1,100 +0,0 @@ -=head1 NAME - -loadbars - A small and humble tool to observe server loads - -=head1 SYNOPSIS - -loadbars [LIST OF HOSTNAMES] [OPTIONS] - -=head2 Tested platforms - -This version of loadbars has only been tested on Debian GNU/Linux Wheezy. - -=head2 I like flying elephants - -For any startup params help check out --help on command line or 'h' during program -execution. - -=head2 A few examples however - -loadbars --extended 1 --showcores 1 --height 300 --hosts localhost - -loadbars --hosts localhost,server1.example.com,server2.example.com - -loadbars --cluster foocluster (foocluster is in /etc/clusters [ClusterSSH]) - -=head2 More examples, using shell expansion - -loadbars servername{01,02,03}.example.com - -loadbars servername{01..50}.example.com --showcores 1 - -=head1 DESCRIPTION - -Loadbars is a small script that can be used to observe CPU loads of several remote servers at once in real time. It connects with SSH (using SSH public/private key auth) to several servers at once and vizualizes all server CPUs and memory statistics right next each other (either summarized or each core separately). Loadbars is not a tool for collecting CPU loads and drawing graphs for later analysis. However, since such tools require a significant amount of time before producing results, Loadbars lets you observe the current state immediately. Loadbars does not remember or record any load information. It just shows the current CPU usages like top or vmstat does. - - -=head1 INFO - -=head2 CPU stuff - -st = Steal in % [see man proc] (extended), Color: Red - -gt = Guest in % [see man proc] (extended), Color: Red - -sr = Soft IRQ usage in % (extended), Color: White - -ir = IRQ usage in % (extended), Color: White - -io = IOwait cpu sage in %, Color: Purple - -id = Idle cpu usage in % (extended), Color: Black - -ni = Nice cpu usage in %, Color: Green - -us = User cpu usage in %, Color: Yellow, dark yellow if to>50%, orange if to>50% - -sy = System cpu sage in %, Color: Blue, lighter blue if >30% - -to = Total CPU usage, which is (100% - id) - -pk = Max us+sy peak of last avg. samples (extended) - -1px horizontal line: Maximum sy+us+io of last 'avg' samples (extended) - -=head2 Memory stuff - -Ram: System ram usage in %, Color: Dark grey - -Swp: System swap usage in %, Color: Grey - -=head2 Network stuff - -Rxb: Incoming (received) traffic in %, Color: Light green, normal green if >100% while using low netlink reference. Bar comes from top and is half width. - -Txb: Outgoing (transmitted) traffic in %, Color: Light green, normal green if >100% while using low netlink reference. Bar comes from bottom and is half width. - -When network bar is red: The interface does not exist on the specific remote host. - -=head3 Config file support - -Loadbars tries to read ~/.loadbarsrc and it's possible to configure any option you find in --help but without leading '--'. For comments just use the '#' sign. Sample config: - -=over 4 - -showcores=1 # Always show cores on startup - -=back - -will always show all CPU cores. If you press the 'w' hotkey during program execution your config file will be overwritten using the current settings. - - -=head1 LICENSE - -See package description or project website. - -=head1 AUTHOR - -Paul Buetow - <http://buetow.org> - -=cut diff --git a/docs/loadbars.txt b/docs/loadbars.txt deleted file mode 100644 index a3ac6a2..0000000 --- a/docs/loadbars.txt +++ /dev/null @@ -1,100 +0,0 @@ -NAME - loadbars - A small and humble tool to observe server loads - -SYNOPSIS - loadbars [LIST OF HOSTNAMES] [OPTIONS] - - Tested platforms - This version of loadbars has only been tested on Debian GNU/Linux - Wheezy. - - I like flying elephants - For any startup params help check out --help on command line or 'h' - during program execution. - - A few examples however - loadbars --extended 1 --showcores 1 --height 300 --hosts localhost - - loadbars --hosts localhost,server1.example.com,server2.example.com - - loadbars --cluster foocluster (foocluster is in /etc/clusters - [ClusterSSH]) - - More examples, using shell expansion - loadbars servername{01,02,03}.example.com - - loadbars servername{01..50}.example.com --showcores 1 - -DESCRIPTION - Loadbars is a small script that can be used to observe CPU loads of - several remote servers at once in real time. It connects with SSH (using - SSH public/private key auth) to several servers at once and vizualizes - all server CPUs and memory statistics right next each other (either - summarized or each core separately). Loadbars is not a tool for - collecting CPU loads and drawing graphs for later analysis. However, - since such tools require a significant amount of time before producing - results, Loadbars lets you observe the current state immediately. - Loadbars does not remember or record any load information. It just shows - the current CPU usages like top or vmstat does. - -INFO - CPU stuff - st = Steal in % [see man proc] (extended), Color: Red - - gt = Guest in % [see man proc] (extended), Color: Red - - sr = Soft IRQ usage in % (extended), Color: White - - ir = IRQ usage in % (extended), Color: White - - io = IOwait cpu sage in %, Color: Purple - - id = Idle cpu usage in % (extended), Color: Black - - ni = Nice cpu usage in %, Color: Green - - us = User cpu usage in %, Color: Yellow, dark yellow if to>50%, orange - if to>50% - - sy = System cpu sage in %, Color: Blue, lighter blue if >30% - - to = Total CPU usage, which is (100% - id) - - pk = Max us+sy peak of last avg. samples (extended) - - 1px horizontal line: Maximum sy+us+io of last 'avg' samples (extended) - - Memory stuff - Ram: System ram usage in %, Color: Dark grey - - Swp: System swap usage in %, Color: Grey - - Network stuff - Rxb: Incoming (received) traffic in %, Color: Light green, normal green - if >100% while using low netlink reference. Bar comes from top and is - half width. - - Txb: Outgoing (transmitted) traffic in %, Color: Light green, normal - green if >100% while using low netlink reference. Bar comes from bottom - and is half width. - - When network bar is red: The interface does not exist on the specific - remote host. - - Config file support - Loadbars tries to read ~/.loadbarsrc and it's possible to configure any - option you find in --help but without leading '--'. For comments just - use the '#' sign. Sample config: - - showcores=1 # Always show cores on startup - - will always show all CPU cores. If you press the 'w' hotkey during - program execution your config file will be overwritten using the current - settings. - -LICENSE - See package description or project website. - -AUTHOR - Paul Buetow - <http://buetow.org> - diff --git a/docs/wishlist b/docs/wishlist deleted file mode 100644 index 9d981cd..0000000 --- a/docs/wishlist +++ /dev/null @@ -1,12 +0,0 @@ -* Optimize data polling intervals and make it configurable -* Optimize code (too much cpu usage if there are too many hosts involved). - E.g. do more stuff on the remote side (preparing the data). -* Fast hostnum display -* --tiny switch -* More stats for memory -* More stats for network -* Auto detect single core boxes -* Allow bash expansion/wildcards (e.g. loadbars --hosts server{01..30} -* Make bars more modular (e.g. atm there is always a cpu bar, and network - and mem are optional, everything should be optional). - diff --git a/justfile b/justfile new file mode 100644 index 0000000..d8e117a --- /dev/null +++ b/justfile @@ -0,0 +1,61 @@ +NAME := "loadbars" +VERSION := "0.7.5" + +default: version documentation perltidy + +version: + echo {{VERSION}} > .version + +profile: + perl -d:NYTProf loadbars --hosts localhost + nytprofhtml nytprof.out + +perltidy: + find . -name \*.pm | xargs perltidy -b + perltidy -b {{NAME}} + find . -name \*.bak -delete + +documentation: + pandoc --standalone --to man ./README.md --metadata title="loadbars" --metadata section="1" --metadata date="$(date +%Y-%m-%d)" > ./docs/{{NAME}}.1 + pandoc --from markdown --to plain ./README.md > ./docs/{{NAME}}.txt + +install DESTDIR="": + #!/usr/bin/env bash + if [ ! -d "{{DESTDIR}}/usr/bin" ]; then + mkdir -p {{DESTDIR}}/usr/bin + fi + if [ ! -d "{{DESTDIR}}/usr/share/{{NAME}}" ]; then + mkdir -p {{DESTDIR}}/usr/share/{{NAME}} + fi + cp {{NAME}} {{DESTDIR}}/usr/bin + cp -r ./lib {{DESTDIR}}/usr/share/{{NAME}}/lib + cp -r ./fonts {{DESTDIR}}/usr/share/{{NAME}}/fonts + cp ./.version {{DESTDIR}}/usr/share/{{NAME}}/version + +deinstall DESTDIR="": + #!/usr/bin/env bash + if [ -n "{{DESTDIR}}" ] && [ -f "{{DESTDIR}}/usr/bin/{{NAME}}" ]; then + rm {{DESTDIR}}/usr/bin/{{NAME}} + fi + if [ -n "{{DESTDIR}}" ] && [ -d "{{DESTDIR}}/usr/share/{{NAME}}" ]; then + rm -r {{DESTDIR}}/usr/share/{{NAME}} + fi + +clean: + #!/usr/bin/env bash + if [ -f nytprof.out ]; then + rm nytprof.out + fi + if [ -f tmon.out ]; then + rm tmon.out + fi + if [ -d nytprof ]; then + rm -Rf nytprof + fi + +release: version documentation perltidy + git add -A + git commit -m 'New release {{VERSION}}' + git tag {{VERSION}} + git push --tags + git push origin master diff --git a/lib/Loadbars/Constants.pm b/lib/Loadbars/Constants.pm index 8f6a6d3..36e0a91 100644 --- a/lib/Loadbars/Constants.pm +++ b/lib/Loadbars/Constants.pm @@ -6,7 +6,7 @@ use warnings; use SDL::Color; use constant { - COPYRIGHT => '2010-2013 (c) Paul Buetow <loadbars@dev.buetow.org>', + COPYRIGHT => '2010-2026 (c) Paul Buetow <loadbars@dev.buetow.org>', CONFFILE => $ENV{HOME} . '/.loadbarsrc', CSSH_CONFFILE => '/etc/clusters', CSSH_MAX_RECURSION => 10, diff --git a/lib/Loadbars/Main.pm b/lib/Loadbars/Main.pm index f53bad8..4b750dc 100644 --- a/lib/Loadbars/Main.pm +++ b/lib/Loadbars/Main.pm @@ -60,15 +60,17 @@ sub cpu_parse_line ($) { my $line = shift; my ( $name, %load ); - ( $name, @load{qw(user nice system idle iowait irq softirq steal guest)} ) = + # Modern kernels (2.6.33+) have 10 fields: user nice system idle iowait irq softirq steal guest guest_nice + ( $name, @load{qw(user nice system idle iowait irq softirq steal guest guest_nice)} ) = split ' ', $line; - # Not all kernels support this + # Not all kernels support these fields $load{steal} = 0 unless defined $load{steal}; $load{guest} = 0 unless defined $load{guest}; + $load{guest_nice} = 0 unless defined $load{guest_nice}; $load{TOTAL} = - sum( @load{qw(user nice system idle iowait irq softirq steal guest)} ); + sum( @load{qw(user nice system idle iowait irq softirq steal guest guest_nice)} ); return ( $name, \%load ); } diff --git a/lib/Loadbars/Utils.pm b/lib/Loadbars/Utils.pm index b4798f0..56b829d 100644 --- a/lib/Loadbars/Utils.pm +++ b/lib/Loadbars/Utils.pm @@ -25,7 +25,7 @@ our @EXPORT = qw ( sub say (@) { print "$_\n" for @_; return undef } sub newline () { say ''; return undef } sub debugsay (@) { say "Loadbars::DEBUG: $_" for @_; return undef } -sub sum (@) { my $sum = 0; $sum += $_ for @_; return $sum } +sub sum (@) { my $sum = 0; $sum += $_ // 0 for @_; return $sum } sub null ($) { defined $_[0] ? $_[0] : 0 } sub notnull ($) { $_[0] != 0 ? $_[0] : 1 } sub error ($) { die shift, "\n" } @@ -1,6 +1,6 @@ #!/usr/bin/perl -# loadbars (c) 2010 - 2013, Paul Buetow +# loadbars (c) 2010 - 2026, Paul Buetow # E-Mail: loadbars@dev.buetow.org WWW: http://buetow.org # For legal informations see COPYING and COPYING.FONT |
