summaryrefslogtreecommitdiff
path: root/README.md
blob: c1cc2d5d1bcab5e96457afef6104976b906af147 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# 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.

## Go version (loadbars-go)

A Go rewrite is available in this repo. Build and run:

```bash
go build -o loadbars-go ./cmd/loadbars
./loadbars-go --hosts localhost
# or: just go-build && ./loadbars-go --hosts localhost
```

Remote hosts need no Perl: the Go binary pipes `scripts/loadbars-remote.sh` over SSH. Install: `just go-install DESTDIR=/tmp/loadbars`.

## 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>