Docker Community Forums

Share and learn in the Docker community.

Command "docker stats" via ssh


(Fbertin) #1

Hi

On my Linux system, I try

ssh root@10.197.237.79 'docker stats --no-stream ’

and it works. Then I try

ssh root@10.197.237.79 'docker stats --no-stream --format “{{.Container}}” ’

and I receive the message “unknown flag: --format”

I also try with " but it’s not succesfull.

Does anyone already try this ?

Thank you for your help


(Think) #2

does it work on http://play-with-docker.com for you?
For me it works. It often happens that some systems convert the -- to something else :slight_smile:


(Fbertin) #3

Thx to try to respond.
However I do not succeed to use these commands in "play-with-docker"
When I try
ssh root@10.0.142.4 ‘ls’ => it works
ssh root@10.0.142.4 ‘docker stats’ => bash:docker: command not found

but docker is of course available on 10.0.142.4 !!! Don’t understand

For my problem “–no-stream” is Ok, so I don’t think that the problem come from "–"
I have tried different thing with caracter " or ’ or the same with \ but no hope…


(Fbertin) #4

Hi

Problem resolved. The targeted machine 10.197.237.79 had an old docker release and “–format” was not available…