So I want to monitor my Jitsi Videobridge to get some useful statistics. The instructions say to enable Videobridge statistics and then grab stuff from port 8080.
Ok, I think I did that, but it did not work. Time to dig into the container network config.
And while I have a lot of network namespaces, they are unknown to
ip netns, as can be seen when asking for a list. When we define a network namespace with
ip netns, it will symlink the assigned name from
/proc/<pid>/ns/net of the process that leads that namespace.
So these are our container names, we want them as netns names:
We can turn them into PIDs:
And with that, we can create a mapping script:
Sure enough, I can now
ip netns things:
@ascii158 points me at
as an alternative solution. That works, but is also quite a lot to type. Like the former solution it needs a script, just a different one. It still is more flexible: works with non-network namespaces and does not need to update a static lookup table.
It also highlights the fact that
docker ps prints a lot of different identifiers, none of which are the actual PID. Which is funny, because that is kind of the point of a thing called
ps, isn’t it?