Environment
Inspect a machine#
A runbook for answering "what is this box?" with only the tools in a minimal Alpine Linux image (BusyBox). The machine here is the page's own virtual machine, so the numbers describe it, not your computer.
Who and where#
#identitysh (POSIX)
echo "user: $(id -un) (uid $(id -u))"
echo "host: $(hostname)"
uname -srm
cat /etc/alpine-releaseCPU#
The machine has one virtual CPU.
#cpush (POSIX)
grep -c '^processor' /proc/cpuinfo
head -n 12 /proc/cpuinfoMemory#
#memorysh (POSIX)
head -n 5 /proc/meminfo
echo
free -mMemAvailable is the number to watch. MemFree ignores memory the kernel can take back from caches.
Disks and mounts#
#disksh (POSIX)
df -h#mountssh (POSIX)
mount | head -n 20Look for the root file system and for tmpfs mounts such as /tmp and /dev/shm. The kernel's own view is in /proc/mounts.
Processes#
#procssh (POSIX)
ps
echo
uptimeLoad and uptime in the raw#
#rawsh (POSIX)
cat /proc/loadavg
cat /proc/uptimeThe three load numbers are the 1, 5 and 15 minute averages, then running and total tasks, then the last process id. The two uptime numbers are seconds up and seconds idle.
Checklist#
- Identify the system (
uname,/etc/*-release). - Count CPUs and read
MemAvailable. - Check free space with
df -hbefore you write anything big. - Read
mountfor read-only or unexpected mounts. - List processes and the load average.