GoAdmio Command Line: cpu with /go/cpu

/go/cpu prints a snapshot of how busy the server is. It shows: If the busiest process is using most of the server's CPU, the command also emails and WhatsApps the server administrator. See Alerts. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

/go/cpu

Examples

# Show the CPU report
/go/cpu

# Show only the CPU line
/go/cpu | grep "^CPU" | head -n 1

# Check recent runs
tail /var/log/go/cpu.log

Output

----------------------------------------
CPU: 12% (4 Cores / 8 Threads)
----------------------------------------
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
...
----------------------------------------
CPU: 12% (4 Cores / 8 Threads)
----------------------------------------

Part Meaning
CPU: <n>% The 1-minute load average divided by the number of threads. 100% means the load equals the number of threads. It is not the same as current CPU utilization, and it can go above 100% when work is queued.
<n> Cores / <n> Threads Physical cores and logical processors.
Process table The header plus the nine busiest processes, sorted by %CPU.

The separator lines are as wide as the terminal, or 40 characters when there is no terminal, for example when run by cron. The CPU line is printed twice: before and after the process table.

What %CPU means

%CPU comes from ps and shows each process’s average CPU use since it started, not what it is using right now. A process that was busy hours ago can rank high, and one that has just started spinning can rank low. A single process can exceed 100% when it uses several threads.

Logging

Every run is appended to /var/log/go/cpu.log.

See the full reference at /go/cpu and the GoAdmio command index.

GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.

By:

Posted in:


Leave a Reply

Your email address will not be published. Required fields are marked *