Top-like interface for container metrics

Overview

ctop

release homebrew

Top-like interface for container metrics

ctop provides a concise and condensed overview of real-time metrics for multiple containers:

ctop

as well as a single container view for inspecting a specific container.

ctop comes with built-in support for Docker and runC; connectors for other container and cluster systems are planned for future releases.

Install

Fetch the latest release for your platform:

Debian/Ubuntu

Maintained by a third party

echo "deb http://packages.azlux.fr/debian/ buster main" | sudo tee /etc/apt/sources.list.d/azlux.list
wget -qO - https://azlux.fr/repo.gpg.key | sudo apt-key add -
sudo apt update
sudo apt install docker-ctop

Arch

ctop is available for Arch in the AUR

Linux (Generic)

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

OS X

brew install ctop

or

sudo curl -Lo /usr/local/bin/ctop https://github.com/bcicen/ctop/releases/download/v0.7.5/ctop-0.7.5-darwin-amd64
sudo chmod +x /usr/local/bin/ctop

Docker

docker run --rm -ti \
  --name=ctop \
  --volume /var/run/docker.sock:/var/run/docker.sock:ro \
  quay.io/vektorlab/ctop:latest

Building

Build steps can be found here.

Usage

ctop requires no arguments and uses Docker host variables by default. See connectors for further configuration options.

Config file

While running, use S to save the current filters, sort field, and other options to a default config path (~/.config/ctop/config on XDG systems, else ~/.ctop).

Config file values will be loaded and applied the next time ctop is started.

Options

Option Description
-a show active containers only
-f set an initial filter string
-h display help dialog
-i invert default colors
-r reverse container sort order
-s select initial container sort field
-v output version information and exit

Keybindings

Key Action
Open container menu
a Toggle display of all (running and non-running) containers
f Filter displayed containers (esc to clear when open)
H Toggle ctop header
h Open help dialog
s Select container sort field
r Reverse container sort order
o Open single view
l View container logs (t to toggle timestamp when open)
e Exec Shell
c Configure columns
S Save current configuration to file
q Quit ctop

Alternatives

See Awesome Docker list for similar tools to work with Docker.

Issues
  • Negative Uptime

    Negative Uptime

    Linux RHEL8.4 Docker version 20.10.8, build 3967b7d ctop 0.76

    Uptime is displayed negatively for some containers, see attachments of docker ps -a compared to ctop image image .

    opened by mshedsilegx 18
  • Wrong green symbol

    Wrong green symbol

    I started today first time ctop in docker:

    docker run --rm -ti --name=ctop --volume /var/run/docker.sock:/var/run/docker.sock:ro quay.io/vektorlab/ctop:latest

    And there are the wrong green symbols:

    image

    opened by somera 14
  • v0.7.7 release?

    v0.7.7 release?

    Hi there,

    I'm interested in the v0.7.7 release to resolve the issue fixed by https://github.com/bcicen/ctop/pull/281 .

    As I see no open issues for the 0.7.7 milestone, are there any blockers for getting that out? If there are, I'd be happy to help!

    Thanks!

    opened by saifelse 10
  • CPU usage always 0%

    CPU usage always 0%

    The CPU collum in the overview shows 0% for all containers since a few versions. The CPU graph in the container details page works fine tho. I put the containers under some load and the value stays at 0% even if tho htop shows a CPU utilization by the processes inside the container.

    grafik

    OS: Up to date Arch Linux Docker Version: 20.10.8 Docker API Version: 1.41 CTop Version: 0.7.6

    opened by Flova 10
  • not updating containers

    not updating containers

    After a while, the list of containers shown in ctop doesn't match docker stats Can't provide much more than that at the moment.

    ctop version 0.7.2, build 70bd2ae go1.11.3 Docker version 18.09.7, build 2d0083d Ubuntu 18.04.3 LTS

    opened by delanym 7
  • Panic: Get http://...:2376/containers/json?all=1: malformed response

    Panic: Get http://...:2376/containers/json?all=1: malformed response

    Environment OSX Sierra 10.12.1

    Docker setup: docker-machine (vm)

    So I installed ctop the way that your README instructed, and I set my docker host env variable (in my ~/.bash_profile) and when I run ctop, I get the following error

    panic: Get http://192.168.99.100:2376/containers/json?all=1: malformed HTTP response "\x15\x03\x01\x00\x02\x02"
    
    bug report enhancement 
    opened by david4shure 7
  • Can't `go get` with Go 1.11

    Can't `go get` with Go 1.11

    I just installed Go 1.11:

    $ go get github.com/bcicen/ctop
    # github.com/bcicen/ctop/cwidgets/single
    go/src/github.com/bcicen/ctop/cwidgets/single/cpu.go:23:11: cannot use tmpData (type []float64) as type map[string][]float64 in assignment
    go/src/github.com/bcicen/ctop/cwidgets/single/cpu.go:26:11: cannot use cpu.hist.Data (type []float64) as type map[string][]float64 in assignment
    go get github.com/bcicen/ctop  23.46s user 9.85s system 94% cpu 35.074 total
    
    opened by mrichman 6
  • Race detector reports data races

    Race detector reports data races

    Hi, when running ctop with the -race flag (I did go build -race), one encounters problems of the following kind:

    ==================
    ==================
    WARNING: DATA RACE
    Read at 0x00c4201720d0 by goroutine 27:
      main.(*GridCursor).RefreshContainers()
          /path/to/src/github.com/bcicen/ctop/cursor.go:18 +0x5f
      main.RefreshDisplay()
          /path/to/src/github.com/bcicen/ctop/grid.go:67 +0x93
      main.Display.func9()
          /path/to/src/github.com/bcicen/ctop/grid.go:124 +0x2f
      github.com/bcicen/ctop/vendor/github.com/gizak/termui.(*EvtStream).Loop.func1()
          /path/to/src/github.com/bcicen/ctop/vendor/github.com/gizak/termui/events.go:251 +0x160
    
    Previous write at 0x00c4201720d0 by goroutine 26:
      main.(*GridCursor).RefreshContainers()
          /path/to/src/github.com/bcicen/ctop/cursor.go:33 +0xa1
      main.RefreshDisplay()
          /path/to/src/github.com/bcicen/ctop/grid.go:67 +0x93
      main.Display.func9()
          /path/to/src/github.com/bcicen/ctop/grid.go:124 +0x2f
      github.com/bcicen/ctop/vendor/github.com/gizak/termui.(*EvtStream).Loop.func1()
          /path/to/src/github.com/bcicen/ctop/vendor/github.com/gizak/termui/events.go:251 +0x160
    
    Goroutine 27 (running) created at:
      github.com/bcicen/ctop/vendor/github.com/gizak/termui.(*EvtStream).Loop()
          /path/to/src/github.com/bcicen/ctop/vendor/github.com/gizak/termui/events.go:247 +0x1b2
      github.com/bcicen/ctop/vendor/github.com/gizak/termui.Loop()
          /path/to/src/github.com/bcicen/ctop/vendor/github.com/gizak/termui/events.go:278 +0x4a
      main.Display()
          /path/to/src/github.com/bcicen/ctop/grid.go:135 +0x74f
      main.main()
          /path/to/src/github.com/bcicen/ctop/main.go:100 +0x608
    
    Goroutine 26 (finished) created at:
      github.com/bcicen/ctop/vendor/github.com/gizak/termui.(*EvtStream).Loop()
          /path/to/src/github.com/bcicen/ctop/vendor/github.com/gizak/termui/events.go:247 +0x1b2
      github.com/bcicen/ctop/vendor/github.com/gizak/termui.Loop()
          /path/to/src/github.com/bcicen/ctop/vendor/github.com/gizak/termui/events.go:278 +0x4a
      main.Display()
          /path/to/src/github.com/bcicen/ctop/grid.go:135 +0x74f
      main.main()
          /path/to/src/github.com/bcicen/ctop/main.go:100 +0x608
    

    Is this a known issue? Any help appreciated.

    Greets

    opened by bpicode 6
  • I/O metrics?

    I/O metrics?

    ctop is awesome! Great tool. It already tracks CPU, memory, and network usage. But I'd also find it very useful to see metrics related to disk I/O, both inside and outside the container. Would such a feature be possible?

    opened by hexpunk 6
  • Add Ports information to the expanded view

    Add Ports information to the expanded view

    For a project I'm working, it's very practical to be able to see which ports are open/exposed, so I've made this "dirty" implementation to see them within the expanded view (I felt they cluttered the compact view way too much).

    I think some variation of this could be a useful addition to ctop, perhaps adding an option to disable/enable it ("p" key?).

    Feel free to completely drop the request if it's not in line with the project.

    opened by kenan-rhoton 6
  • Shows docker containers but no usage on OVH Dedicated

    Shows docker containers but no usage on OVH Dedicated

    Hi,

    I have a dedicated server at OVH, and the current release of CTOP seems to not work on it:

    capture d ecran 2017-03-10 a 07 51 12

    capture d ecran 2017-03-10 a 07 54 46

    I can see my one container, but there's no mem/cpu/rx-tx working it seems, even though I'm using the container and top sees activity.

    Uname -a:

    Linux xxxx 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt25-2+deb8u3 (2016-07-02) x86_64 GNU/Linux
    

    Processor is (there's 4 of them):

    cat /proc/cpuinfo
    processor	: 0
    vendor_id	: GenuineIntel
    cpu family	: 6
    model		: 54
    model name	: Intel(R) Atom(TM) CPU N2800   @ 1.86GHz
    stepping	: 1
    microcode	: 0x10d
    cpu MHz		: 798.000
    cache size	: 512 KB
    physical id	: 0
    siblings	: 4
    core id		: 0
    cpu cores	: 2
    apicid		: 0
    initial apicid	: 0
    fpu		: yes
    fpu_exception	: yes
    cpuid level	: 10
    wp		: yes
    flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts nopl nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm movbe lahf_lm arat dtherm
    bogomips	: 3733.22
    clflush size	: 64
    cache_alignment	: 64
    address sizes	: 36 bits physical, 48 bits virtual
    power management:
    
    

    ctop version is:

    wget https://github.com/bcicen/ctop/releases/download/v0.4/ctop-0.4-linux-amd64 -O ctop
    

    If you need extra info, ask away.

    Also, I didn't try compiling on premises, I used the release.

    opened by Gui13 6
  • ASCII-text-only status column

    ASCII-text-only status column

    New optional column displaying container status using plain text characters (sans symbols/icons)

    As suggested by @Brayyy in https://github.com/bcicen/ctop/issues/293#issuecomment-1183918016:

    State:

    • created: "C" (white)
    • running: "R" (green)
    • exited: "e" or "x" (gray)
    • paused: "p" (blue)

    Health:

    • healthy: "H" (green)
    • unhealthy: "U" or "!" (red)
    • starting: "s" (gray)
    feature 
    opened by bcicen 0
  • Unicode characters not showing in MacOS Terminal

    Unicode characters not showing in MacOS Terminal

    Hi guys,

    I have tried to display the ctop status icons but have not been successful.

    Some details:

    • My locale is en_US.UTF-8 and it is configured as-is in the mac terminal.
    • I'm using Nerdfonts. I don't know if it could have something to do with it.

    SCR-20220729-nb2

    opened by juanra 1
  • port binding - docker-compose

    port binding - docker-compose

    I have been using this for some time and happy with the info it provides and the low resources it needs

    However, it would be more practical to have an optional port to locally open the container, i.e. use docker-compose and have it accessed behind a reverse proxy rather than running it attached mode using CLI.

    for example:

    docker run --name=ctop -p 1234:1234 --volume /var/run/docker.sock:/var/run/docker.sock:ro quay.io/vektorlab/ctop:latest

    opened by tamimology 0
  • Bump github.com/opencontainers/runc from 1.1.0 to 1.1.2

    Bump github.com/opencontainers/runc from 1.1.0 to 1.1.2

    Bumps github.com/opencontainers/runc from 1.1.0 to 1.1.2.

    Changelog

    Sourced from github.com/opencontainers/runc's changelog.

    [1.1.2] - 2022-05-06

    I should think I’m going to be a perpetual student.

    Security

    • A bug was found in runc where runc exec --cap executed processes with non-empty inheritable Linux process capabilities, creating an atypical Linux environment. For more information, see GHSA-f3fp-gc8g-vw66 and CVE-2022-29162.

    Changed

    • runc spec no longer sets any inheritable capabilities in the created example OCI spec (config.json) file.

    [1.1.1] - 2022-03-28

    Violence is the last refuge of the incompetent.

    Added

    • CI is now also run on centos-stream-9. (#3436)

    Fixed

    • runc run/start can now run a container with read-only /dev in OCI spec, rather than error out. (#3355)
    • runc exec now ensures that --cgroup argument is a sub-cgroup. (#3403)
    • libcontainer systemd v2 manager no longer errors out if one of the files listed in /sys/kernel/cgroup/delegate do not exist in container's cgroup. (#3387, #3404)
    • Loose OCI spec validation to avoid bogus "Intel RDT is not supported" error. (#3406)
    • libcontainer/cgroups no longer panics in cgroup v1 managers if stat of /sys/fs/cgroup/unified returns an error other than ENOENT. (#3435)
    Commits
    • a916309 VERSION: release 1.1.2
    • 364ec0f runc: do not set inheritable capabilities
    • 5854665 merge branch 'pr-3439' into release-1.1
    • 8959e37 VERSION: back to development
    • 52de29d VERSION: release 1.1.1
    • 2636e1c CHANGELOG.md: add 1.1.1 release notes
    • ae28db1 Merge pull request #3436 from kolyshkin/1.1-add-centos-stream-9
    • 036cc34 CI/cirrus: add centos-stream-9
    • c653632 Merge pull request #3438 from kolyshkin/1.1-fix-badges
    • db95315 README.md: add cirrus-ci badge
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Unable to build

    Unable to build

    # wget https://github.com/bcicen/ctop/archive/refs/tags/v0.7.7.tar.gz
    # tar xzf v0.7.7.tar.gz 
    # cd ctop-0.7.7/
    # make build
    fatal: Not a git repository (or any of the parent directories): .git
    go mod download
    go: github.com/fsouza/[email protected] requires
            github.com/Microsoft/[email protected] requires
            github.com/containerd/[email protected]: invalid version: git fetch --unshallow -f origin in /root/go/pkg/mod/cache/vcs/7dc259a25d788a1983e1fa125424a7a8dbadf02fe44dd23233ef975e59c0f6f2: exit status 128:
            fatal: git fetch-pack: expected shallow list
    make: *** [build] Errore 1
    
    # go version
    go version go1.16.13 linux/amd64
    
    # cat /etc/redhat-release 
    CentOS Linux release 7.9.2009 (Core)
    
    opened by asarubbo 0
Releases(v0.7.7)
Owner
bradley
Prototyping from the corner deli.
bradley
An os/exec like interface for running a command in a container, and being able to easily interact with stdin, stdout, and other adjustments

dockerexec An "os/exec" like interface for running a command in a container, and being able to easily interact with stdin, stdout, and other adjustmen

Segev Finer 2 Jul 14, 2022
A CLI application to extract the top customers, and their favourite snacks.

zimpler.candystore An assignment which written as a CLI application in Golang for Zimpler interview process. Getting Started This repository includes

null 0 Dec 24, 2021
null 0 Jan 27, 2022
I like reading news but I also like the terminal. I am leaning and practicing my go.

I made an api and didn't know how to use it. Screenshots The initial screen when you first run the app. The screen after you specify an id. This app u

Daniel M. Matongo 2 Jan 14, 2022
Go library and CLIs for working with container registries

Go library and CLIs for working with container registries

Google 32 Jun 1, 2021
Go library and CLIs for working with container registries

Go library and CLIs for working with container registries

Google 1.9k Jul 31, 2022
CLI tool and library for generating a Software Bill of Materials from container images and filesystems

A CLI tool and Go library for generating a Software Bill of Materials (SBOM) from container images and filesystems. Exceptional for vulnerability dete

Anchore, Inc. 2.9k Aug 8, 2022
wy : a set of command-line tools to test your container-based platform

wy wy (Abbreviation of Would You) is a set of command-line tools to test your container-based platform. ToC: Commands Deployment Monitoring Contributi

Yusuke Kuoka 2 Apr 30, 2022
Option container for golang

Option Option provides an Option container which can be used to force some addit

Nik Polakov 4 Dec 21, 2021
A simple logging interface that supports cross-platform color and concurrency.

WLog Package wlog creates simple to use UI structure. The UI is used to simply print to the screen. There a wrappers that will wrap each other to crea

Will Dixon 57 May 31, 2022
Command Line Interface for Terraform Enterprise/Cloud ( tecli )

In a world where everything is Terraform, teams use Terraform Cloud API to manage their workloads. TECLI increases teams productivity by facilitating such interaction and by providing easy commands that can be executed on a terminal or on CI/CD systems.

Amazon Web Services - Labs 200 Jun 30, 2022
Disk usage analyzer with console interface written in Go

Gdu is intended primarily for SSD disks where it can fully utilize parallel processing. However HDDs work as well, but the performance gain is not so huge.

Daniel Milde 1.9k Aug 8, 2022
Heroku Terminal User Interface

_ _ _ | |_| |_ _ _(_) | ' \ _| || | |

PierreKieffer 108 May 29, 2022
FireFly Command Line Interface (CLI)

FireFly CLI The FireFly CLI can be used to create a local FireFly stacks for offline development of blockchain apps. This allows developers to rapidly

Kaleido 1 Mar 1, 2022
a command line interface to orbit.love

orbit-cli NAME: orbit-cli - a command line interface to orbit.love USAGE: orbit-cli [global options] command [command options] [arguments...]

Geoffrey Huntley 4 May 18, 2021
Lux is a command-line interface for controlling and monitoring Govee lighting strips built in Go.

What is Lux? Lux is a command-line interface for controlling and monitoring Govee lighting strips built in Go. Lux provides it's users with the abilit

BanDev 42 Jul 27, 2022
FireFly Command Line Interface (CLI)

FireFly CLI The FireFly CLI can be used to create a local FireFly stacks for offline development of blockchain apps. This allows developers to rapidly

null 37 Jul 17, 2022
Command line interface for flomo.

flomo-cli A Golang based command line interface of flomo. 中文说明 Features Type and save to flomo using command line. Editor mode supports, able to use v

Eason Yang 14 May 17, 2022
User interface engine and widget library for Ebiten

Ebiten UI A user interface engine and widget library for Ebiten Ebiten UI is an extension to Ebiten that provides an engine to render a complete user

Maik Schreiber 255 Jul 24, 2022