A command line / text based Linux Containers monitoring tool that works just like you expect.
.. image:: https://github.com/yadutaf/ctop/raw/master/screenshots/screenshot.png
In a hurry?
.. code:: bash
curl -sSl https://raw.githubusercontent.com/yadutaf/ctop/master/cgroup_top.py > /opt/ctop && python /opt/ctop
ctop will help you see what's going on at the container level. Basically,
containers are a logical group of processes isolated using kernel's cgroups and
namespaces. Recently, they have been made popular by Docker and they are also
heavily used under the hood by systemd and a load of container tools like lxc,
rocket, lmctfy and many others.
Under the hood, ctop will collect all metrics it can from cgroups in realtime and render them to instantly give you an overview of the global system health.
It currently collects metrics related to cpu, memory and block IO usage as well as metadata such as owning user (mostly for systemd based containers), uptime and attempts to guess the container managing technology behind.
When the container technology has been successfully guessed, additional features are exposed like attaching to container (basically, it opens a shell in the container context) and stopping it.
ctop author uses it on production system to quicky detect biggest memory
users in low memory situations.
Note: since 2017-07-27, the reported memory will exclude cache memory to align on Docker design decision.
As a monitoring tool, ctop tries to be as discreet as possible. Nonetheless
it still has some expectations. It will need at least Python 2.6 with builtin
curses support to run. This is usually found with Debian 6 and newer.
This said, the recommended installation method relies on pip
.. code:: bash
pip install ctop ctop
If using pip is not an option, which is often the case on production systems, you may also directly grab the self-contained source file directly from github and run it in place. All you'll need is Python 2.6 (Debian Squeeze):
.. code:: bash
wget https://raw.githubusercontent.com/yadutaf/ctop/master/cgroup_top.py -O ctop chmod +x ctop ./ctop
Alternatively, if you are a Boot2docker user, you may install a Dockerized version of ctop instead. Please note that this is experimental. You have to have a docker binary inside your container to control / attach to your containers from ctop using this method:
.. code:: bash
docker pull yadutaf/ctop docker run --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro --volume=/var/run/docker.sock:/var/run/docker.sock -it --rm yadutaf/ctop
Command line:
.. code:: text
Monitor local cgroups as used by Docker, LXC, SystemD, ...
Usage: ctop [--tree] [--refresh=] [--columns=] [--sort-col=] [--follow=] [--fold=, ...] [--type=, ...] ctop (-h | --help)
Options: --tree Show tree view by default. --fold= Start with cgroup path folded --follow= Follow/highlight cgroup at path. --type=TYPE Only show containers of this type --refresh= Refresh display every [default: 1]. --columns= List of optional columns to display. Always includes 'name'. [default: owner,processes,memory,cpu-sys,cpu-user,blkio,cpu-time]. --sort-col= Select column to sort by initially. Can be changed dynamically. [default: cpu-user] -h --help Show this screen.
Control:
p to toggle/pause the refresh and select text.f to let selected line follow / stay on the same container. Default: Don't follow.q or Ctrl+C to quit.F5 to toggle tree/list view. Default: list view.↑ and ↓ to navigate between containers.+ or - to toggle child cgroup foldingAdditionally, for supported container types (Currently Docker, LXC and OpenVZ):
a to attach to console output.e to open a shell in the container context. Aka 'enter' container.s to stop the container (SIGTERM).k to kill the container (SIGKILL).c to checkpointing the container(OpenVZ only now - run 'vzctl chkpnt CTID')MIT
Content type
Image
Digest
sha256:95ccc8981…
Size
23.6 MB
Last updated
about 9 years ago
docker pull yadutaf/ctop