The lxc-info command displays information about a container:
$ lxc-info -n containerName Name: testContainer State: STOPPED
This command will only display information about a single container, though. Using a shell loop, as described in Chapter 1, Shell Something Out, we can display information about all the containers:
$ for c in `lxc-ls` do lxc-info -n $c echo done Name: name1 State: STOPPED Name: name2 State: RUNNING PID: 1234 IP 10.0.3.225 CPU use: 4.48 seconds BlkIO use: 728.00 KiB Memory use: 15.07 MiB KMem use: 2.40 MiB Link: vethMU5I00 TX bytes: 20.48 KiB RX bytes: 30.01 KiB Total bytes: 50.49 KiB
If the container is stopped, there is no status information available. Running containers record their CPU, memory, disk (block), I/O, and network usage. This tool lets you monitor your containers to see which ones are most active.