[Lxc-users] Stats 'n' Stuff

Gordon Henderson gordon at drogon.net
Sat Nov 12 19:45:15 UTC 2011


On Sat, 12 Nov 2011, Matt Franz wrote:

> Yes.  The random Ethernet device names make monitoring with munin zenoss 
> or whatever very painful.
>
> One of the nice features of openvz is that it uses the container ID in 
> the device name which will be consistent across container reboots and 
> also allows you to easily identify which Nic belongs to the container so 
> you can easily view traffic stats across multiple containers while only 
> monitoring the bare metal host.
>
> The right answer would be to find the .c or .sh that creates the devices 
> (assuming it is in user space) and modify that code so the random Device 
> names can be overridden.

Actually, that's not an issue - you can trivially fix the device name in 
the config file - e.g.

lxc.network.veth.pair = veth-dsr

it's the device number used in mrtg that's the issue.

So running cfgmaker on that device shows:

### Interface 204 >> Descr: 'veth-dsr' | Name: 'veth-dsr' | Ip: '' | Eth: '66-5a-6c-77-d4-76' ###

but if I stop and start the container:

### Interface 208 >> Descr: 'veth-dsr' | Name: 'veth-dsr' | Ip: '' | Eth: '66-5a-6c-77-d4-76' ###

it's interface ID changes from 204 to 208... And it's the ID number that's 
coded into the mrtg files. (And I'm not sure how snmp handles it either)

Maybe other monitoring systems handle it better...

Gordon




More information about the lxc-users mailing list