Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] netns support in inputs.net section #2340

Closed
gfrey6wind opened this issue Jan 30, 2017 · 3 comments
Closed

[Feature request] netns support in inputs.net section #2340

gfrey6wind opened this issue Jan 30, 2017 · 3 comments

Comments

@gfrey6wind
Copy link

Hello,

I noticed during my last tests that interfaces which has been moved in another netns that default one are no more seen by telegraf.

For example, if you have the following in your /etc/telegraf/telegraf.conf file:
[...]
[[inputs.net]]
interfaces = ["enp4s0f0", "enp4s0f1", "enp6s0f0", "enp6s0f1", "enp5s0f0"]
[...]

Then, put your interface enp5s0f0 in a new netns:
~# ip netns add telegraf_test
~# ip link set dev enp5s0f0 netns telegraf_test
~# ip netns exec telegraf_test ip link set dev enp5s0f0 up

Telegraf cannot get enp5s0f0 statistics anymore.

Is it the expected behavior ?

If so, it is a hard limitation for all the applications which use netns.
Is this feature planned ?

Thanks,
Gabriel

@phemmer
Copy link
Contributor

phemmer commented Jan 30, 2017

I personally would recommend against telegraf implementing namespace support directly. In fact it will likely be impossible anyway (due to the way namespaces work, and having to spawn a new process to live inside the namespace).

Addressing this exact use case is why I opened #2087
However as an alternate solution, once #2094 is merged you can use it to solve the use case as well (by using unix domain sockets).

@sparrc
Copy link
Contributor

sparrc commented Jan 30, 2017

agreed, there are no plans to support namespaces, and as @phemmer said I don't think it's possible without creating a new process

@sparrc sparrc closed this as completed Jan 30, 2017
@gfrey6wind
Copy link
Author

Thanks @phemmer and @sparrc for your replies.

I understand the reasons for why you're against a such feature.
Thanks for your advises, I will use input.exec waiting for #2094 solution.

Thanks,
Gabriel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants