-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
IPTables input not working #2215
Comments
you'll need to provide more information for debugging this. Can you try using a |
Here is a more detailed log, also containing the other metrics that I used. Here is a screenshot my InfluxDB query; As you can see, there's only one database. No mistakingly using the wrong one. You can see all of the other measurements, like I said before, those work fine. IPTables is just not pushing data into InfluxDB. It looks like its able to gather data, but I cant confirm this. I tried running it as root, still no results in InfluxDB. Permissions should no longer be the issue. http://prntscr.com/dtfadu Note: I'm a beginner when it comes to Linux, if you want me to do something, please provide some commands. :) |
please provide the configuration entry for the iptabels plugin |
Here you go |
what happens if you run |
Result of the command: https://hastebin.com/cojodofegu.sql |
did you edit your sudoers file?: https://github.com/influxdata/telegraf/tree/master/plugins/inputs/iptables#using-sudo |
Yes I did. Pretty sure you're able to see from the first log I provided that IPTables is able to open a session with root privileges. Never the less, the sudoers file contains |
I don't think it's setup properly if it's asking for a password. The point is that telegraf needs to be able to run a "sudo" command without a password |
It asks for a password when I try to login as the user, like I said. It does not ask for a password when using sudo, as set up in the sudoers file: |
Can you try using a |
I replaced the InfluxDB output with a file output and let it run about half a minute. https://hastebin.com/eketosujon.go (Sorry for the wait) |
seems like it must be a permissions issue, sorry I can't help debug that any further, but the best I can advise you would be to login as the telegraf user and attempt to run the provided iptables command. If there are any steps that are not already outlined in the documentation that you find helpful, please consider submitting a PR to clarify. If you have any evidence that shows otherwise, feel free to reopen the issue. |
https://hastebin.com/dogijahaca.vbs Does this not indicate that it's able to use the sudo command and check IPTables? There is no no-permission error anywhere to be seen. How do I even login as the telegraf user? I don't have any credentials. The log states that it's able to gather metrics, but they don't end up in InfluxDB. Sure this is not a bug..? |
I just ran telegraf as root for a minute, while pinging the server in another window. Pings are blocked duo to the default firewall rule of DROP. https://hastebin.com/figoqojufo.rb I'm now fully sure, this is not a permission issue. |
I'm having the same problem on a Debian Wheezy installation, even with running telegraf in root or with In
Another problem I have noticed on debian is that the path to iptables is not The other plugins are working well. |
I've had similar issues today on Debian Jessie.
And run this afterwards:
Here's what my sudoers file for the telegraf user has:
You may check, if sudo works properly by running this as root:
If this gives the expected output, the iptables plugin should work as well! 😄 |
same problem.
works as expected, but it does not output any data. sound likes iptables plugin does not work and also there is no log in telegraf.log |
OK, I'll reopen, if anyone can post exact steps to reproduce it would be helpful for us |
Telegraf Config: sudo configuration: no permission problem. there is no output as measurement for iptables. Thank you |
Same issue as @fahimeh2010 I managed to get the permissions working, but nothing ends up in my database. All tests, logs files, etc are already listed way above. |
@ririsoft can you take a look at this? |
From the documentation:
Looking at the file provided by @MrDienns the iptables rules do not have any comment, thus explaining your results. You have to add comment to the rules you want to monitor using iptables comment module for instance: For @fahimeh2010 and others I have no iptables output but I suspect this is the issue, unless proven the contrary. This behavior was discussed when I initially submitted this plugin. Maybe we can do better here. Any idea is welcome. |
@ririsoft it seems to be confusing a fair amount of people, so it's probably worth making the documentation state this more obviously, and also even put a |
@sparrc I wish I had a better idea for this than just improving the documentation. I discover that it was also discussed on the iptables mailing list 13 years ago without a better solution than what we propose here unfortunately. |
During issue #2215 it was highlighted that the current behavior where rules without a comment are ignored is confusing for several users. This commit improves the documentation and adds a NOTE to the sample config to clarify the behavior for new users.
…a#2482) During issue influxdata#2215 it was highlighted that the current behavior where rules without a comment are ignored is confusing for several users. This commit improves the documentation and adds a NOTE to the sample config to clarify the behavior for new users.
…a#2482) During issue influxdata#2215 it was highlighted that the current behavior where rules without a comment are ignored is confusing for several users. This commit improves the documentation and adds a NOTE to the sample config to clarify the behavior for new users.
During issue #2215 it was highlighted that the current behavior where rules without a comment are ignored is confusing for several users. This commit improves the documentation and adds a NOTE to the sample config to clarify the behavior for new users.
Hello
Im trying to get the iptables input to work for telegraf. After already having a bunch of issues using permissions, I finally got it "working". The systemd output from iptables can be found here: https://hastebin.com/umikevodos.vbs
To be me this looks like iptables is properly being able to use sudo, as defined in the config, and upload its data to the server. Whenever I check the server though, there are no measurements for iptables. There's nothing there. I tested this on multiple servers, and none of them is pushing data towards InfluxDB.
All other inputs from telegraf seem to work fine.
Ubuntu 16.04 LTS
Telegraf 1.1.1
The text was updated successfully, but these errors were encountered: