GrepBoard/Manuals
605 manuals ·

Pre-install crisis diagnostic tools on Ubuntu 24.04 and Rocky 9

·Tested on Ubuntu 24.04.5, Rocky Linux 9.8 (Docker) · 2026-10·Test scope ↓·5 steps

Install sysstat, bpftrace, bcc and perf before an outage. Package names, versions, disk space and sar collection defaults compared on Ubuntu 24.04 and Rocky 9.

Once a server is crawling or its network is gone, pulling tools with apt or dnf gets hard, so diagnostic tools belong on the box beforehand. The same set was installed in Ubuntu 24.04 and Rocky 9 containers to compare package names, versions, space used and the state right after installation.

[1] Map the package names first. The same tool can have a different name, and one was missing from Rocky's default repositories.

PurposeUbuntu 24.04 package (version)Rocky 9 package (version)
sar, iostat, mpstat, pidstatsysstat 12.6.1sysstat 12.5.4
vmstat, top, freeprocps 4.0.4procps-ng 3.3.17
Per-process disk I/Oiotop-c 1.26iotop 0.6
System call tracingstrace 6.8strace 6.12
Packet capturetcpdump 4.99.4tcpdump 4.99.0
eBPF one-linersbpftrace 0.20.2bpftrace 0.24.2
eBPF tool collectionbpfcc-tools 0.29.1 (128 *-bpfcc)bcc-tools 0.35.0 (130 entries in tools/)
CPU profilinglinux-tools-common + per-kernel packageperf 5.14.0-687.60.1
NIC settings and statsethtool 6.7ethtool 6.15
Open fileslsof 4.95lsof 4.94
NIC utilisationnicstat 1.95Not in default repos
Kernel event tracingtrace-cmd 3.2trace-cmd 3.3.1
NUMAnumactl 2.0.18numactl 2.0.19
ss, ipiproute2 6.1.0iproute 6.17.0

A single unknown name makes the whole dnf install stop, as it did here:

console
$ dnf -y -q --setopt=install_weak_deps=False install sysstat procps-ng iotop strace tcpdump bpftrace bcc-tools ethtool lsof nicstat trace-cmd numactl iproute perf > /tmp/inst.log 2>&1; tail -3 /tmp/inst.logError: Unable to find a match: nicstat

[2] Install them, without recommended/weak dependencies.

console
$ sudo apt install --no-install-recommends sysstat procps iotop-c strace tcpdump bpftrace bpfcc-tools ethtool lsof nicstat trace-cmd numactl iproute2 linux-tools-common linux-tools-$(uname -r)
console
$ sudo dnf --setopt=install_weak_deps=False install sysstat procps-ng iotop strace tcpdump bpftrace bcc-tools ethtool lsof trace-cmd numactl iproute perf

On Ubuntu, perf only runs with the linux-tools-<kernel version> package matching the running kernel. With the common package alone you get this (the container sees the host kernel, so no per-kernel package was installed):

console
$ perf --versionWARNING: perf not found for kernel 6.8.0-147   You may need to install the following packages for this specific kernel:    linux-tools-6.8.0-147-generic    linux-cloud-tools-6.8.0-147-generic…

To have the matching linux-tools follow every kernel upgrade, keep linux-tools-generic installed, as the message suggests.

[3] Plan the disk space. The total of /usr, /var and /etc was measured before and after (du -sxm, so the unit is MiB):

BeforeAfterAdded
Ubuntu 24.04 (without the per-kernel linux-tools-<version>)134 MiB466 MiB332 MiB
Rocky 9 (without nicstat)303 MiB716 MiB413 MiB

The Ubuntu row is the command in [2] minus linux-tools-$(uname -r); on a real server that package adds to the total.

Most of it is compiler machinery pulled in by the eBPF tools. The largest packages were libllvm18 and libclang-cpp18 on Ubuntu and gcc-toolset-15-gcc, llvm-libs and clang-libs on Rocky. On small VMs, drop bpfcc-tools/bcc-tools and keep only bpftrace.

[4] Make sure sar history is actually recorded. Live sar sampling works right after installation, but looking back in time needs collection to be running:

console
$ sar 2>&1 | head -2Cannot open /var/log/sysstat/sa27: No such file or directoryPlease check if data collecting is enabled

That was the Ubuntu container; on Rocky the path is /var/log/sa/. The two differed right after installation:

Ubuntu 24.04Rocky 9
systemd unitsLinks created for sysstat.service, sysstat-collect.timer, sysstat-summary.timerAll three enabled
Extra switchENABLED="false" in /etc/default/sysstatNone
Data directory/var/log/sysstat//var/log/sa/

Unpacking the Ubuntu package shows two collection paths. Under systemd, sysstat-collect.timer starts sysstat-collect.service, which runs /usr/lib/sysstat/sa1 directly, and sa1 does not look at ENABLED. ENABLED is read by the cron path's /usr/lib/sysstat/debian-sa1 (which exits unless it is true) and by the package's configuration script, which enables or disables the three units (sysstat-collect.timer, sysstat-summary.timer, sysstat.service) to match it. So on a systemd server, whether collection runs is decided by the timer state. systemd does not run in a container, so whether the timer is on right after installation on a real server was not verified.

console
$ systemctl is-enabled sysstat-collect.timer sysstat-summary.timer sysstat$ systemctl is-active sysstat-collect.timer$ ls -l /var/log/sysstat/

Note the output of the first two lines before changing anything. If the timer is disabled or inactive, turn it on. So that a later package reconfigure or upgrade does not switch it off again, set ENABLED in /etc/default/sysstat to "true" as well (the file's comment allows only true and false; the debconf value sysstat/enable was also false after installation).

console
$ sudo sed -i 's/^ENABLED="false"/ENABLED="true"/' /etc/default/sysstat$ sudo systemctl enable --now sysstat-collect.timer sysstat-summary.timer sysstat

The timer fires every 10 minutes, so after about 20 minutes check for an saDD file in /var/log/sysstat/. To undo, return to the state you noted with sudo systemctl disable --now sysstat-collect.timer sysstat-summary.timer and ENABLED="false". On Rocky the three units were already enabled; if they are off, use sudo systemctl enable --now sysstat.

[5] Write down the order you will use during an incident. With these installed, memory problems can be traced through the journal as in find what the OOM killer killed, CPU and disks with sar -u, sar -d and iostat -x 1, and individual processes with pidstat 1 and iotop-c.

#sysstat#bpftrace#bcc#perf#troubleshooting