[Lxc-users] How I can get CPU load in LXC container from Host ?

Ulli Horlacher framstag at rus.uni-stuttgart.de
Sun Mar 4 17:31:39 UTC 2012


On Sun 2012-03-04 (13:49), Xavier Garcia wrote:

> There is any way to execute a command inside a running container from host ?

I have written a small daemon "lxc-cmdd" running inside the container,
which the host-script "lxc" can connect to.
Example:

root at zoo:~# lxc -l
container              disk (MB)    RAM (MB)   start-PID    status
fex                            -           8        1230   running
gopher                         -           7        8583   running
ubuntu                         -           0           0   stopped
vmtest1                        -           0           0   stopped
vmtest8                        -           0           0   stopped

root at zoo:~# lxc -x fex "uname -a;uptime"
Linux fex.uni-stuttgart.de 2.6.38-13-server #54~lucid1-Ubuntu SMP Wed Jan 4 14:38:03 UTC 2012 x86_64 GNU/Linux
 18:25:17 up 19 days,  6:32,  0 users,  load average: 0.00, 0.01, 0.05

root at zoo:~# lxc-ps --lxc | grep cmdd
fex         1344 ?        00:00:00 lxc-cmdd
gopher      8623 ?        00:00:00 lxc-cmdd


http://fex.rus.uni-stuttgart.de/lxc-ubuntu
http://fex.rus.uni-stuttgart.de/download/lxc.tar

-- 
Ullrich Horlacher              Server- und Arbeitsplatzsysteme
Rechenzentrum                  E-Mail: horlacher at rus.uni-stuttgart.de
Universitaet Stuttgart         Tel:    ++49-711-685-65868
Allmandring 30                 Fax:    ++49-711-682357
70550 Stuttgart (Germany)      WWW:    http://www.rus.uni-stuttgart.de/
REF: <CAPipkoq32U9AHBs4LRPxNkO69TVtLccXyyyA_BBAAz+1T5v56A at mail.gmail.com>




More information about the lxc-users mailing list