I want to monitor the network traffic on my machines. For this I use the simple net input like so:
[[inputs.net]]
interfaces = ["eth0"]
This works on one machine but not on the other. I’m puzzled by this. I can’t imagine I messed up the config since it is so little and the same config works on the other machine. I also double checked the interface. This is clearly correct.
Could it be some permissions issue? Perhaps the telegraf user is not allow to read from the device? How do I debug this?
I’m using Ubuntu 16.04 and Telegraf 1.2.1.
To check if it is a permission issue, you could try sudo telegraf --test to run the inputs one time and exit. If it works as root, but not as a regular user, then it is probably permission related.
The net plugin reads /proc/net/dev, so you could also try cat /proc/net/dev as the telegraf user.
Haha! Running with sudo gave a different output.
My kernel is compiled with grsec… My only real option is to run telegraf as root. Not sure how comfortable I’m with that.