Docker container monitoring using Ctop

CTOP provides a linux “top” alike interface for monitoring the Docker containers running on the machine. It provides concise view of the docker containers and the metrics associated with each, which includes CPU, Memory and Disk/network IO . This tool will be helpful while troubleshooting the performance issue on Docker containers running on the machine. In this article we will see how to setup docker container monitoring using Ctop

How to install CTOP Linux/Centos ?

Find the appropriate package for your platform from here

For Centos/Linux

You can download it using following command

1 sudo wget https://github.com/bcicen/ctop/releases/download/v0.6.0/ctop-0.6.0-linux-amd64 -O /usr/local/bin/ctop

Now we need to make the downloaded file executable. Run the following command

1 chmod +x /usr/local/bin/ctop

Now you can check it using the “help”

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21   [root@localhost ~]# ctop -h ctop container metric viewer   usage: ctop [options]   options:   a show active containers only connector string container connector to use (default “docker”) f string filter containers h display this help dialog i invert default colors r reverse container sort order s string select container sort field v output version information and exit [root@localhost ~]#  

Hurraay !!! . CTOP application is working now. Now let us use it to see the status of containers running on our machine

Run following command

1 ctop a

It will list all running containers with associated metrics. Please see the screenshots below

docker-container-monitoring-using-ctop

As you can see in the above image, there are two containers which are in “active” status. It shows the memory, CPU and  IO metrics.

There is an “expanded” view also, where we can see metrics on a particular container. To view  extended stats on a container, Press “Enter”  after selecting one container. The “expanded” view look like below

ne-docker-container-monitoring-using-ctop

 This tool gives a good interface for the “docker stats”  command line option . 

1 2 3 4 5 6   #docker stats CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS bd9877c86f7a 0.08% 311 MiB / 7.561 GiB 4.02% 0 B / 0 B 228.3 MB / 29.46 MB 17 c308c751c54f 0.00% 7.375 MiB / 7.561 GiB 0.10% 738 B / 648 B 7.993 MB / 0 B 2  

You will see same metrics inside ctop also , but in a better interface.

As always, feel free to drop us a note if you have any queries or feedbacks using our comment form below. Always happy to help you ????

Author: , 0000-00-00