Top-like interface for container metrics

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.

Owner
bradley
Prototyping from the corner deli.
bradley
Comments
  • 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 .

  • 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

  • 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!

  • 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

  • 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

  • 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"
    
  • 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
    
  • 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

  • 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?

  • 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.

  • 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.

  • CTOP crash when accessing gitlab container widget

    CTOP crash when accessing gitlab container widget

    Hey,

    when I want to access the widget for the gitlab container ctop crashes with this message: image

    But when I e. g. access the widget from traefik, all works fine, incl. all other containers: image

    So what's going wrong here? And is here already an issue up which I haven't found or maybe already a PR?

    Would be nice to get this fixed :)

  • fix(sec): upgrade github.com/opencontainers/runc to 1.1.2

    fix(sec): upgrade github.com/opencontainers/runc to 1.1.2

    What happened?

    There are 1 security vulnerabilities found in github.com/opencontainers/runc v1.1.0

    What did I do?

    Upgrade github.com/opencontainers/runc from v1.1.0 to 1.1.2 for vulnerability fix

    What did you expect to happen?

    Ideally, no insecure libs should be used.

    The specification of the pull request

    PR Specification from OSCS

  • Incorrect display status unicode characters. 0.7.7

    Incorrect display status unicode characters. 0.7.7

    When containers status - RUN.

    image

    When containers status - STOPED.

    image (1)

    I was doing:

    • Test this case on all fonts.
    • Changed locale.

    Characters is working correct only with v.0.7.6 and may be lower.

    OC: Ubuntu 22.04.1 LTS.

  • [ERROR] Failed to locate cgroup mountpoints

    [ERROR] Failed to locate cgroup mountpoints

    $ ctop [ERROR] Failed to locate cgroup mountpoints.

    system info: Linux version 5.15.0-48-generic (buildd@bos02-arm64-037) (gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #54-Ubuntu SMP Fri Aug 26 13:31:33 UTC 2022

  • `go.mod` should be tidy up by `go mod tidy`?

    `go.mod` should be tidy up by `go mod tidy`?

    I found ctop is written by golang.

    That means I can install it by go install if I had install golang?

    I try like:

    ✗ go install github.com/bcicen/ctop@latest
    

    But I got this:

    go: github.com/bcicen/ctop@latest (in github.com/bcicen/[email protected]):
            The go.mod file for the module providing named packages contains one or
            more replace directives. It must not contain directives that would cause
            it to be interpreted differently than if it were the main module.
    

    Then I found go.mod in project:

    module github.com/bcicen/ctop
    
    require (
    	github.com/BurntSushi/toml v0.3.1
    	github.com/c9s/goprocinfo v0.0.0-20170609001544-b34328d6e0cd
    	github.com/fsouza/go-dockerclient v1.7.0
    	github.com/gizak/termui v2.3.1-0.20180817033724-8d4faad06196+incompatible
    	github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b // indirect  --------------- this line
    	github.com/jgautheron/codename-generator v0.0.0-20150829203204-16d037c7cc3c
    	github.com/mattn/go-runewidth v0.0.2
    	github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d
    	github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d
    	github.com/op/go-logging v0.0.0-20160211212156-b2cb9fa56473
    	github.com/opencontainers/runc v1.1.0
    	github.com/pkg/browser v0.0.0-20201207095918-0426ae3fba23
    	github.com/pkg/errors v0.9.1
    	github.com/stretchr/testify v1.4.0
    )
    

    I clone the project, and run go mod tidy,

    I got go.mod like:

    module github.com/bcicen/ctop
    
    require (
    	github.com/BurntSushi/toml v0.3.1
    	github.com/c9s/goprocinfo v0.0.0-20170609001544-b34328d6e0cd
    	github.com/fsouza/go-dockerclient v1.7.0
    	github.com/gizak/termui v2.3.1-0.20180817033724-8d4faad06196+incompatible
    	github.com/hako/durafmt v0.0.0-20210608085754-5c1018a4e16b   // ---------- this line changed without indirect
    	github.com/jgautheron/codename-generator v0.0.0-20150829203204-16d037c7cc3c
    	github.com/mattn/go-runewidth v0.0.2
    	github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d
    	github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d
    	github.com/op/go-logging v0.0.0-20160211212156-b2cb9fa56473
    	github.com/opencontainers/runc v1.1.0
    	github.com/pkg/browser v0.0.0-20201207095918-0426ae3fba23
    	github.com/pkg/errors v0.9.1
    )
    

    Is this bug? Should I PR to fix it?

    Or ctop just make it like that to let user DO NOT install ctop by go install?

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

Jul 14, 2022
I like reading news but I also like the terminal. I am leaning and practicing my go.
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

Jan 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

Dec 24, 2021
Jan 27, 2022
Go library and CLIs for working with container registries
Go library and CLIs for working with container registries

Go library and CLIs for working with container registries

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

Go library and CLIs for working with container registries

Dec 27, 2022
CLI tool and library for generating a Software Bill of Materials from container images and filesystems
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

Jan 6, 2023
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

Apr 30, 2022
Option container for golang

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

Dec 21, 2021
A simple logging interface that supports cross-platform color and concurrency.
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

Sep 26, 2022
Command Line Interface for Terraform Enterprise/Cloud ( tecli )
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.

Dec 16, 2022
Disk usage analyzer with console interface written in Go
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.

Jan 7, 2023
Heroku Terminal User Interface
Heroku Terminal User Interface

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

Nov 24, 2022
FireFly Command Line Interface (CLI)
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

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...]

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

Dec 28, 2022
FireFly Command Line Interface (CLI)
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

Dec 13, 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

Sep 19, 2022
User interface engine and widget library for Ebiten
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

Nov 5, 2022