Hello good people. Linux monitoring is a crucial activity for any systems administrator. I know that having the right tools for this purpose is not an easy task. In this article, we’ll look at the Linux top command alternative called gotop.
Gotop is a terminal based graphical activity monitor inspired by gtop. I’ll cover gtop installation in a different article. Unlike Gtop which is written in Node.js, gotop is written in Golang.
Installing gotop on Linux – CentOS, Ubuntu e.t.c
Since gotop is distributed as a binary package, there is no prerequisite apart from git and curl packages which you can easily install on your Linux distribution.
Install git and curl on CentOS / Fedora
# yum -y install git curl
Installing git and curl on Ubuntu / Debian
# apt-get -y install git curl
Clone gotop source from Github.
# git clone git clone --depth 1 https://github.com/cjbassi/gotop.git Cloning into 'gotop'... remote: Counting objects: 603, done. remote: Compressing objects: 100% (460/460), done. remote: Total 603 (delta 140), reused 463 (delta 123), pack-reused 0 Receiving objects: 100% (603/603), 1.19 MiB | 3.46 MiB/s, done. Resolving deltas: 100% (140/140), done.
Navigate to the gotop directory and run auto-installer script.
# cd gotop # ./download.sh
The script will download a gotop binary for your Linux CPU architecture. Supported architectures are:
The command above will download the latest stable archive and extract it. You should see a binary package named gotop in your current directory, you need to copy this to a path in your $PATH.
# echo $PATH # cp gotop /usr/local/bin # cd # which gotop /usr/local/bin/gotop
To run gotop, just type the name of the command on your terminal shell:
This will run gotop with the default command options. You should get a screen like below:
The help page can be accessed from:
From above help screen, you can pass some options to filter output you get. E.g
Check currently installed version:
# gotop -v 1.2.14
Show minimal output, i.e CPU and RAM usage stats using:
# gotop --minimal
The output should be similar to below:
Gotop key bindings
q or <Ctrl-c> : Used to quit gotop program
<up>/<down> and j/k: Navigate up and down
<Ctrl-d> and <Ctrl-u>: up and down half a page
<Ctrl-f> and <Ctrl-b>: up and down a full page
gg and G: Jump to top and bottom
<tab>: toggle process grouping
dd: kill the selected process or process group
h and l: zoom in and out of CPU and Mem graphs
?: toggles keybind help menu
You can also do sorting based on memory or cpu usage:
c: Sort based on CPU utilization
m: Sort based on Memory usage
p: Sort based PID
The color schemes for gotop are available under the colorschemes directory:
# ls colorschemes/ default_dark.go monokai.go solarized.go template.go default.go monokai.png solarized.png
You can set a different Colorscheme can be set with the -c flag followed its name, e.g
# gotop -c monokai
It should start gotop with monokai colorscheme.
That’s all for today. Enjoy using a gotop command for easy to visualize process monitoring and your server compute resource utilization.