Home Command line utilities Ctop – A Commandline Monitoring Tool For Linux Containers
ctop - A Commandline Monitoring Tool For Linux Containers

Ctop – A Commandline Monitoring Tool For Linux Containers

By sk
133 Views

A while ago, we have written about a tool called "Portainer", a web-based Docker management tool. Using Portainer, we can easily create, delete, and manage containers. In this guide, we will see how to monitor those Linux containers from commandline using "ctop". It is a simple utility like 'top' command, which is used to display the running processes. Using ctop, you can easily monitor the Linux containers right from your Terminal. It comes with built-in Docker support, and provides a compact overview of multiple containers.

In this brief guide, we will see how to install and use it in Linux.

Install ctop on Linux

ctop is available in AUR, so you can install it using AUR helpers, such as YaY, in Arch Linux and its variants such as Antergos and Manjaro Linux.

$ yay -S ctop

For other Linux distributions, download the latest ctop version from the official download page and install it as described below.

$ sudo wget https://github.com/bcicen/ctop/releases/download/v0.7.2/ctop-0.7.2-linux-amd64 -O /usr/local/bin/ctop
$ sudo chmod +x /usr/local/bin/ctop

Also, you can install and run it via Docker. To do so, you need to install Docker on your Linux machine. Refer the following links to install Docker on CentOS and Ubuntu.

Once you installed Docker, run ctop like below.

$ docker run -ti -v /var/run/docker.sock:/var/run/docker.sock quay.io/vektorlab/ctop:latest

We have now installed ctop. It's time to see how to use it.

ctop Usage

ctop usage is fairly easy and straight forward.

You can start monitoring the Containers using command:

$ ctop

If there are any containers running in your system, you will see an output something like below.

Ctop

Ctop

Here, you can view the list of running containers, and its CPU and memory usage, and Transmit(TX) and receive(RX) metrics.

Press 'a' to toggle between running and non-running containers. To display the help section, press 'h'. To quit ctop, press 'q'. Here is the complete list of ctop function keys.

  • a - Toggle display of all (running and non-running) containers
  • f - Filter displayed containers
  • H - Toggle ctop header
  • h - Open help section
  • s - Select container sort field
  • r - Reverse container sort order
  • q - Quit ctop

ctop is just a basic, yet fully functional monitoring tool for Linux containers. It does exactly what it says on the official website. If you're looking for a simple commandline monitoring options for your containers, ctop might be a good choice.

You might want to download our free Docker Ebooks.

And, that's all for today. If you find this guide useful, share it on your professional and social networks and support OSTechNix.

More good stuffs to come. Stay tuned!

Cheers!

Resource:

Thanks for stopping by!

Help us to help you:

Have a Good day!!

You May Also Like

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More