
Ctop – commandline monitoring for containers - vektorlab
https://bcicen.github.io/ctop/
======
__jal
Demonstrating once again that 99% of software development is reimplementation
with another layer of indirection.

(Not that I'm complaining; this is a needed tool.)

~~~
digi_owl
And one that the world has basically been through once already. But the first
time it happened in the insular world of corporate and university mainframes.

~~~
amorphid
When we start writing web browsers in WebAssembly, we shall have gone too far.

~~~
ygjb
Given that webkit.js uses emscripten to build webkit for JS, and emscripten
can target the wasm backend, ummm.. this is largely already done :)

Obligatory reference:
[https://www.youtube.com/watch?v=9nazm3_OXac](https://www.youtube.com/watch?v=9nazm3_OXac)

I think it is going to be very cool to see exactly how powerful and flexible
this sort thing will become - how long til you demo a new tool by launching a
linux container built on a webassembly vm that allows you to experiment with a
new app with zero deploy effort.

~~~
qznc
The effort is to visit a url.

An alternative possible today: `docker run -it rockstar:testbed newtool`

Even older, Java Web Start provided this in 2001.

------
amaranth
Forget containers, where can I get a commandline monitoring tool this slick
for regular processes? I feel like we skipped a step here.

~~~
SwellJoe
I'm oddly excited about command line tools lately. I've recently been porting
all of our shell scripts to have color text output and Unicode status
indicators (like a green checkmark for "OK" or red X for failure), when the
terminal supports it (which, these days, is almost always). It just gives
things a really polished feel that CLI tools don't always have.

I've used tools like dialog, in the past, but I've never really been a big
fan; they seem like the worst of both worlds. It has the low-information
density and high interaction requirements of a GUI, without actually looking
really cool in the way a GUI can.

That's my long-winded way of saying, I also really like the way this looks,
and I'm totally stealing some of the visual ideas here for my own tools.

~~~
digi_owl
As of late i find myself thinking that the big DEs have been a massive
distraction from what made _nix so potent. While Windows and Mac had largely
tried to hide or distance themselves from the CLI in favor of the GUI, the way
X11 is implemented allows CLI programs to use GUI for enhancements rather than
replacements.

~~~
drchickensalad
How is that so?

~~~
digi_owl
[https://feh.finalrewind.org/](https://feh.finalrewind.org/)

That is a image viewer that can be operated from the command line but that
then produce a GUI window (or windows) that can be manipulated by mouse and
keyboard.

It has also various options for displaying image properties in the terminal.

Meaning that it could be leveraged along with existing _nix CLI tools to fine
images in a large directory (or even directory tree) and then display the
result, all by piping commands together.

------
gkfasdfasdf
Very cool...also, you can run on Docker For Windows using Docker itself:

    
    
      C:\ctop> type Dockerfile
      from buildpack-deps:jessie
      run curl -fsSL https://github.com/bcicen/ctop/releases/download/v0.4/ctop-0.4-linux-amd64 -o ctop && chmod +x ctop
      cmd ./ctop
      C:\ctop> docker build -t ctop .
      C:\ctop> docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock ctop

------
playa1
This looks amazing!

Too bad that the name collides with the Ubuntu package ctop which installs
[https://github.com/yadutaf/ctop](https://github.com/yadutaf/ctop)

~~~
nicolaslem
When I saw this post I was sure it was about yadutaf's project. The name
collision is indeed unfortunate since the two projects basically do the same
thing.

------
brunoqc
Isn't it recommended to not make Docker listen on the TCP port?

~~~
andrewguenther
You should always use a UNIX socket if you don't need remote access.

~~~
noinsight
SSH supports forwarding UNIX sockets...

~~~
andrewguenther
Would not recommend

------
voldezar
You can get same output with: docker stats $(docker ps --format={{.Names}})

------
vzaliva
Looks cool. I am trying to avoid manually installing software, especially on
production machines. It makes it difficult to maintain and upgrade. Any plans
for `apt` package?

~~~
djsumdog
I tried `go get -u github.com/bcicen/ctop` since I prefer uses the source, but
there appear to be some syntax errors in master. Guess I could have added the
tag, but I just used the binary.

You should check if `fpm` has support for making packages for go projects (It
should. It supports Python and Ruby). Then it should be simply to create
packages, sign them and put them on your company repo.

I've worked at shops where we do this and even run update scripts to tell us
when new versions are available and kick of the fpm build process.

~~~
icebraining
fpm can package anything, you can literally throw any old directory at it and
get a .deb or .rpm out.

------
moondev
So awesome. Would be nice to hook this in to k8s in some way. I guess you
could mount the socket and run it in a pod

------
lirantal
Really cool. I also wrote a similar tool - Dockly, which provides a more
complete management of docker containers through the CLI.

[https://github.com/lirantal/dockly](https://github.com/lirantal/dockly)

------
israrkhan
"docker stats" give you same information, although I have to admit this one
has better ui.

~~~
djsumdog
TIL about docker stats. Hmm... it gives you the container hash instead of the
name. Yea I agree, cgit is a much better interface.

~~~
theta_d
docker stats $(docker ps --format={{.Names}})

------
zurn
Didn't we have this already?
[https://linuxcontainers.org/lxc/manpages/man1/lxc-
top.1.html](https://linuxcontainers.org/lxc/manpages/man1/lxc-top.1.html)

------
broodbucket
Is there an equivalent for VMs that uses libvirt or something?

------
ah-
Please someone port this to Kubernetes.

~~~
vektorlab
No port necessary, an interface for connecting other container/cluster systems
is already defined. Feel free to open a feature request
([https://github.com/bcicen/ctop/issues](https://github.com/bcicen/ctop/issues))
for k8s to included as a connector in future releases.

------
vladsanchez
Much needed tool. Instant Love! Thanks.

------
thejosh
kind of like sysdig.

------
williamstein
very cool!!

