On Mon, May 06, 2013 at 07:54:04PM +0200, Allan Latham wrote:
> netstat gets the information from:
> /proc/net/tcp and /proc/net/udp
> The trick must be to make this part of the /proc
> tree fully visible at the host level.
> How I do that is a complete mystery!
it is completely visible from the spectator context
so for example:
ncontext --migrate --nid 1 -- cat /proc/net/tcp
will show the information for all network contexts,
given that guest privacy is not enabled, i.e.
# CONFIG_VSERVER_PRIVACY is not set
> My vservers are skeletons containing only the minimum needed
> for the service running in the vserver. Few (none) will have
> netstat available to run via 'vserver exec' and its friends.
> Therefore the need to monitor them from the host.
for obvious reasons, the host context only sees the
connections belonging to the host processes, similar
to the processes (host context = 0) but the spectator
context (1) has all the information.
HTC,
Herbert
> Greetings to all
> Allan
> On 06/05/13 18:38, Ghislain wrote:
>> would be curious too,
>> I tried
>> sudo ncontext --migrate --nid 1 -- netstat -nlp
>> sudo chcontext --silent --ctx 1 netstat -nlp
>> but none give me all the sockets :), the closer i got was:
>> sudo vsomething vserver --running -- exec netstat -nlp|sort
>> perhaps there is not an observer context for network.
>> Ghislain.