{"id":13416325,"url":"https://github.com/yadutaf/ctop","last_synced_at":"2025-03-14T23:31:38.782Z","repository":{"id":27951153,"uuid":"31443861","full_name":"yadutaf/ctop","owner":"yadutaf","description":"A command line / text based Linux Containers monitoring tool that works just like you expect.","archived":true,"fork":false,"pushed_at":"2017-10-02T02:16:33.000Z","size":238,"stargazers_count":424,"open_issues_count":3,"forks_count":34,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-10-01T23:05:59.559Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://pypi.python.org/pypi/ctop","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yadutaf.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-27T23:30:48.000Z","updated_at":"2024-09-22T06:20:40.000Z","dependencies_parsed_at":"2022-09-04T09:10:49.816Z","dependency_job_id":null,"html_url":"https://github.com/yadutaf/ctop","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yadutaf%2Fctop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yadutaf%2Fctop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yadutaf%2Fctop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yadutaf%2Fctop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yadutaf","download_url":"https://codeload.github.com/yadutaf/ctop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243663514,"owners_count":20327300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-30T21:00:57.097Z","updated_at":"2025-03-14T23:31:35.145Z","avatar_url":"https://github.com/yadutaf.png","language":"Python","funding_links":[],"categories":["Container Operations","Terminal User Interface","Python"],"sub_categories":["User Interface"],"readme":"CTOP\n====\n\nA command line / text based Linux Containers monitoring tool that works just like you expect.\n\n.. image:: https://github.com/yadutaf/ctop/raw/master/screenshots/screenshot.png\n\nIn a hurry?\n\n.. code:: bash\n\n    curl -sSl https://raw.githubusercontent.com/yadutaf/ctop/master/cgroup_top.py \u003e /opt/ctop \u0026\u0026 python /opt/ctop\n\nIntroduction\n------------\n\n``ctop`` will help you see what's going on at the container level. Basically,\ncontainers are a logical group of processes isolated using kernel's cgroups and\nnamespaces. Recently, they have been made popular by Docker and they are also\nheavily used under the hood by systemd and a load of container tools like lxc,\nrocket, lmctfy and many others.\n\nUnder the hood, ctop will collect all metrics it can from cgroups in realtime\nand render them to instantly give you an overview of the global system health.\n\nIt currently collects metrics related to cpu, memory and block IO usage as well\nas metadata such as owning user (mostly for systemd based containers), uptime\nand attempts to guess the container managing technology behind.\n\nWhen the container technology has been successfully guessed, additional features\nare exposed like attaching to container (basically, it opens a shell in the\ncontainer context) and stopping it.\n\n``ctop`` author uses it on production system to quicky detect biggest memory\nusers in low memory situations.\n\nFeatures\n--------\n\n- collect cpu, pids, memory and blkio metrics\n- collect metadata like task count, owning user, container technology\n- sort by any column\n- filter by container type (docker, lxc, systemd, ...)\n- optionally display logical/tree view\n- optionally fold/unfold sub cgroup tree\n- optionally follow selected cgroup/container\n- optionnaly pause the refresh (typically, to select text)\n- detects Docker, LXC, unprivileged LXC, OpenVZ and systemd based containers\n- supports advanced features for Docker, LXC and OpenVZ based containers\n- detects qemu-kvm virtual machines (with libvirt only)\n- supports advanced features for qemu-kvm VMs (via virsh)\n- open a shell/attach to supported container types for further diagnose\n- stop/kill/chekpointing supported container types\n- click to sort / reverse\n- click to select cgroup\n- no external dependencies beyond Python \u003e= 2.6 or Python \u003e= 3.0\n\n\u003e Note: since 2017-07-27, the reported memory will exclude cache memory to\n\u003e align on Docker design decision.\n\nInstallation\n------------\n\nAs a monitoring tool, ``ctop`` tries to be as discreet as possible. Nonetheless\nit still has some expectations. It will need at least Python 2.6 with builtin\ncurses support to run. This is usually found with Debian 6 and newer.\n\nThis said, the recommended installation method relies on pip\n\n.. code:: bash\n\n  pip install ctop\n  ctop\n\nIf using pip is not an option, which is often the case on production systems,\nyou may also directly grab the self-contained source file directly from github\nand run it in place. All you'll need is Python 2.6 (Debian Squeeze):\n\n.. code:: bash\n\n  wget https://raw.githubusercontent.com/yadutaf/ctop/master/cgroup_top.py -O ctop\n  chmod +x ctop\n  ./ctop\n\nAlternatively, if you are a Boot2docker user, you may install a Dockerized\nversion of ctop instead. Please note that this is experimental. You have to\nhave a docker binary inside your container to control / attach to your\ncontainers from ctop using this method:\n\n.. code:: bash\n\n  docker pull yadutaf/ctop\n  docker run --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro --volume=/var/run/docker.sock:/var/run/docker.sock -it --rm yadutaf/ctop\n  # Optionally, to resolve uids to usernames, add '--volume /etc/passwd:/etc/passwd:ro'\n\nUsage\n-----\n\n**Command line**:\n\n.. code:: text\n\n  Monitor local cgroups as used by Docker, LXC, SystemD, ...\n\n  Usage:\n    ctop [--tree] [--refresh=\u003cseconds\u003e] [--columns=\u003ccolumns\u003e] [--sort-col=\u003csort-col\u003e] [--follow=\u003cname\u003e] [--fold=\u003ccgroup\u003e, ...] [--type=\u003ccontainer type\u003e, ...]\n    ctop (-h | --help)\n\n  Options:\n    --tree                 Show tree view by default.\n    --fold=\u003cname\u003e          Start with \u003cname\u003e cgroup path folded\n    --follow=\u003cname\u003e        Follow/highlight cgroup at path.\n    --type=TYPE            Only show containers of this type\n    --refresh=\u003cseconds\u003e    Refresh display every \u003cseconds\u003e [default: 1].\n    --columns=\u003ccolumns\u003e    List of optional columns to display. Always includes 'name'. [default: owner,processes,memory,cpu-sys,cpu-user,blkio,cpu-time].\n    --sort-col=\u003csort-col\u003e  Select column to sort by initially. Can be changed dynamically. [default: cpu-user]\n    -h --help              Show this screen.\n\n\n**Control**:\n\n- press ``p`` to toggle/pause the refresh and select text.\n- press ``f`` to let selected line follow / stay on the same container. Default: Don't follow.\n- press ``q`` or ``Ctrl+C`` to quit.\n- press ``F5`` to toggle tree/list view. Default: list view.\n- press ``↑`` and ``↓`` to navigate between containers.\n- press ``+`` or ``-`` to toggle child cgroup folding\n- click on title line to select sort column / reverse sort order.\n- click on any container line to select it.\n\nAdditionally, for supported container types (Currently Docker, LXC and OpenVZ):\n\n- press ``a`` to attach to console output.\n- press ``e`` to open a shell in the container context. Aka 'enter' container.\n- press ``s`` to stop the container (SIGTERM).\n- press ``k`` to kill the container (SIGKILL).\n- press ``c`` to checkpointing the container(OpenVZ only now - run 'vzctl chkpnt CTID')\n\nRequirements\n------------\n\n* python \u003e=2.6 or python \u003e=3.0, with builtin curses support\n\nLicence\n-------\n\nMIT\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyadutaf%2Fctop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyadutaf%2Fctop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyadutaf%2Fctop/lists"}