{"id":11160,"date":"2019-03-09T23:08:05","date_gmt":"2019-03-09T23:08:05","guid":{"rendered":"http:\/\/www.appservgrid.com\/paw92\/?p=11160"},"modified":"2019-03-09T23:08:05","modified_gmt":"2019-03-09T23:08:05","slug":"ctop-top-like-interface-for-monitoring-docker-containers","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/09\/ctop-top-like-interface-for-monitoring-docker-containers\/","title":{"rendered":"ctop \u2013 Top-like Interface for Monitoring Docker Containers"},"content":{"rendered":"<p><strong>ctop<\/strong>\u00a0is a free open source, simple and cross-platform\u00a0<a href=\"https:\/\/www.tecmint.com\/12-top-command-examples-in-linux\/\" target=\"_blank\" rel=\"noopener\">top-like command-line tool<\/a>\u00a0for monitoring container metrics in real-time. It allows you to get an overview of metrics concerning CPU, memory, network, I\/O for multiple containers and also supports inspection of a specific container.<\/p>\n<div id=\"attachment_29957\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/07\/Docker-Container-Monitoring.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29957\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/07\/Docker-Container-Monitoring.gif\" sizes=\"auto, (max-width: 1195px) 100vw, 1195px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/07\/Docker-Container-Monitoring.gif 1195w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/07\/Docker-Container-Monitoring-768x266.gif 768w\" alt=\"Docker Container Monitoring\" width=\"1195\" height=\"414\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Docker Container Monitoring<\/p>\n<\/div>\n<p>At the time of writing this article, it ships with built-in support for\u00a0<a href=\"https:\/\/www.tecmint.com\/install-docker-and-learn-containers-in-centos-rhel-7-6\/\" target=\"_blank\" rel=\"noopener\">Docker<\/a>\u00a0(default container connector) and\u00a0<strong>runC<\/strong>; connectors for other container and cluster platforms will be added in future releases.<\/p>\n<h3>How to Install ctop in Linux Systems<\/h3>\n<p>Installing the latest release of\u00a0<strong>ctop<\/strong>\u00a0is as easy as running the following commands to download the binary for your Linux distribution and install it under\u00a0<strong>\/usr\/local\/bin\/ctop<\/strong>\u00a0and make it executable to run it.<\/p>\n<pre>$ sudo wget https:\/\/github.com\/bcicen\/ctop\/releases\/download\/v0.7.1\/ctop-0.7.1-linux-amd64  -O \/usr\/local\/bin\/ctop\r\n$ sudo chmod +x \/usr\/local\/bin\/ctop\r\n<\/pre>\n<p>Alternatively, install\u00a0<strong>ctop<\/strong>\u00a0via Docker using following command.<\/p>\n<pre>$ docker run --rm -ti --name=ctop -v \/var\/run\/docker.sock:\/var\/run\/docker.sock quay.io\/vektorlab\/ctop:latest\r\n<\/pre>\n<p><center>Once you have installed\u00a0<strong>ctop<\/strong>, you can run it to list all your containers whether active or not.<\/center><\/p>\n<pre>$ ctop\r\n<\/pre>\n<div id=\"attachment_29953\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/07\/List-All-Docker-Containers.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29953\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/07\/List-All-Docker-Containers.png\" sizes=\"auto, (max-width: 942px) 100vw, 942px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/07\/List-All-Docker-Containers.png 942w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/07\/List-All-Docker-Containers-768x188.png 768w\" alt=\"Monitor Docker Containers\" width=\"942\" height=\"230\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Monitor Docker Containers<\/p>\n<\/div>\n<p>You can use the\u00a0<strong>Up<\/strong>\u00a0and\u00a0<strong>Down<\/strong>\u00a0arrow keys to highlight a container and click\u00a0<strong>Enter<\/strong>\u00a0to select it. You will see a menu as shown in the following screenshot. Choose\u00a0<strong>\u201csingle view\u201d<\/strong>\u00a0and click on it to inspect the selected container.<\/p>\n<div id=\"attachment_29954\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/07\/Monitor-Docker-Container.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29954\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/07\/Monitor-Docker-Container.png\" sizes=\"auto, (max-width: 942px) 100vw, 942px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/07\/Monitor-Docker-Container.png 942w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/07\/Monitor-Docker-Container-768x157.png 768w\" alt=\"Monitor Single Docker Container\" width=\"942\" height=\"192\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Monitor Single Docker Container<\/p>\n<\/div>\n<p>The following screenshot shows the single view mode for a specific container.<\/p>\n<div id=\"attachment_29955\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/07\/inspect-a-single-container.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29955\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/07\/inspect-a-single-container.png\" alt=\"Inspect a Single Container\" width=\"546\" height=\"722\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Inspect a Single Container<\/p>\n<\/div>\n<p>To display active containers only, use the\u00a0<code>-a<\/code>\u00a0flag.<\/p>\n<pre>$ ctop -a \r\n<\/pre>\n<div id=\"attachment_29956\" class=\"wp-caption aligncenter\">\n<p><a href=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/07\/only-show-active-containers.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-29956\" src=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/07\/only-show-active-containers.png\" sizes=\"auto, (max-width: 942px) 100vw, 942px\" srcset=\"https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/07\/only-show-active-containers.png 942w, https:\/\/www.tecmint.com\/wp-content\/uploads\/2018\/07\/only-show-active-containers-768x157.png 768w\" alt=\"Check Active Docker Container\" width=\"942\" height=\"192\" data-lazy-loaded=\"true\" \/><\/a><\/p>\n<p class=\"wp-caption-text\">Check Active Docker Container<\/p>\n<\/div>\n<p>To display CPU as\u00a0<code>%<\/code>\u00a0of system total, use the\u00a0<code>-scale-cpu<\/code>\u00a0option.<\/p>\n<pre>$ ctop -scale-cpu\r\n<\/pre>\n<p>You can also filter containers using the\u00a0<code>-f<\/code>\u00a0flag, for example.<\/p>\n<pre>$ ctop -f app\r\n<\/pre>\n<p>Additionally, you can select initial container sort field using the\u00a0<code>-s<\/code>\u00a0flag, and see the\u00a0<strong>ctop<\/strong>\u00a0help message as shown.<\/p>\n<pre> \r\n$ ctop -h\r\n<\/pre>\n<p>Note that connectors for other container and cluster systems are yet to be added to\u00a0<strong>ctop<\/strong>. You can find more information from the\u00a0<a href=\"https:\/\/github.com\/bcicen\/ctop\" target=\"_blank\" rel=\"nofollow noopener\">Ctop Github repository<\/a>.<\/p>\n<p><strong>ctop<\/strong>\u00a0is a simple top-like tool for visualizing and monitoring container metrics in real-time. In this article, we\u2019ve expalined how to install and use ctop in Linux.<\/p>\n<p><a href=\"https:\/\/www.tecmint.com\/ctop-monitor-docker-containers\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>ctop\u00a0is a free open source, simple and cross-platform\u00a0top-like command-line tool\u00a0for monitoring container metrics in real-time. It allows you to get an overview of metrics concerning CPU, memory, network, I\/O for multiple containers and also supports inspection of a specific container. Docker Container Monitoring At the time of writing this article, it ships with built-in support &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/03\/09\/ctop-top-like-interface-for-monitoring-docker-containers\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;ctop \u2013 Top-like Interface for Monitoring Docker Containers&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-11160","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=11160"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11160\/revisions"}],"predecessor-version":[{"id":11161,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/11160\/revisions\/11161"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=11160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=11160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=11160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}