3

I notice that vnstat isn't installed on CoreOS. Is there a comparable way to monitor network usage on a CoreOS cluster? Certainly one could run vnstat through a Docker container but I assume that would only capture network activity that passes through the container and not the CoreOS node as a whole, right?

Colyn1337
  • 2,397
  • 2
  • 23
  • 40
cboettig
  • 193
  • 1
  • 7
  • have you tried installing vnstat using source code? Have you looked into [modifying coreos using the SDK](https://coreos.com/docs/sdk-distributors/sdk/modifying-coreos/) to include vnstat? – Andrew Domaszek Nov 25 '14 at 21:57
  • Thanks for the suggestions; but it seems this is a routine enough task for any server that there should be standard way of doing it. I don't believe coreos is designed to compile software from source, nor does rebuilding CoreOS from the SDK sound like the prefered way to run services... maybe I'm wrong... – cboettig Nov 25 '14 at 22:00
  • 1
    If CoreOS doesn't provide a tool you need, using the SDK to make a new deploy image so you can have it everywhere in your cluster seems pretty ideal. Worst case scenario, you can use `iptables -nvL FORWARD` to view packet and byte counts for the forward rules, or `tc -s qdisc show` to view the same for the entire interface. – Andrew Domaszek Nov 25 '14 at 22:07
  • 2
    This is what you're looking for: https://coreos.com/docs/cluster-management/debugging/install-debugging-tools/ CoreOS is not intended to have package managers or software installed directly to it, merely to run containers. – theterribletrivium Nov 25 '14 at 23:52
  • @theterribletrivium thanks, that looks promising. Though it's not clear how this would work with vnstat, since the toolbox appears to be aimed at only interactive/debugging use, not monitoring use. presumably it would terminate vnstat once you exited the interactive session, so no logs. – cboettig Nov 26 '14 at 01:42
  • Unfortunately I don't know much about vnstat, but you could use a tool like supervisord to run more than one application and as part of its configuration have it write logs. Here is an example supervisord config with logging: [program:tornado-8000] command=/path/to/app.py --port=8000 stderr_logfile = /var/log/supervisord/tornado-stderr.log stdout_logfile = /var/log/supervisord/tornado-stdout.log You could then run a syslog daemon using supervisord as well and have it send the logs offbox. There are a lot of ways to do this, just food for thought. – theterribletrivium Nov 26 '14 at 02:24
  • yeah, seems a bit hacky compared to monitoring network use on a typical linux distro, but sounds like "use coreOS toolbox container" is the right solution here. If you put that in for the answer I'd be happy to accept it. – cboettig Dec 01 '14 at 21:06

1 Answers1

1

You could do it by passing --net=host when starting a docker container containing whatever monitoring software you need.

You may or may not also need --privileged=true as well.

hookenz
  • 14,472
  • 23
  • 88
  • 143