-
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
Fix snmp tools output parsing when they contain Windows eols #3396
Conversation
I'm getting a timeout, with the following in the log file: |
The timeout is potentially normal, depends on how fast the remote agent responds. Does it ever finish a collection or is it completely stuck?
I don't quite understand what you meant here. |
My telegraf.conf has the following (as in the example documentation):
So regular fields like hostname and uptime return, but anything table related does not return any data.
The output is:
and then it hangs/timesout for 10secs with no further output. When I run it via the Windows service the log file has the error message I mentioned earlier. |
I can confirm that it's working fine for me! |
@pstatho Can you try this build with |
Here is the log output: The command line output is still the same, only the hostname of the switch and uptime are returned, after about 30 seconds. |
@pstatho From the output it looks like the parsing is working, maybe this timeout is unrelated. Any chance your hardware allows you to use Also can you try running this and record the execution time:
|
Running against 127.0.0.1 returns: Running the command against my 26-port switch returns in 12 seconds when I pipe the output to a file to remove and rendering/scrolling delays on the console. When I run it against my 50-port switch it takes 22 seconds (almost double the time). I've tried both v1 and v2c and the time to execute the snmpwalk is the same. |
That's pretty slow but I suspect we won't be able to improve upon the time it takes snmpwalk to do the same operation. I think you will have to increase the interval to approx double the collection time. [[inputs.snmp]]
interval = "1m" @phemmer I don't have much experience with snmp on real hardware, is this typical performance? |
Not for me no. I can run the given config against one of our 48 port switches and it completes in about 5s with version 2c, and about 24s on version 1. Note that doing |
@phemmer ah yes you are correct. When I use Regardless, when I change my telegraf config to use version 2, I still don't get table output when I test it. I tried with the first patch version and teh second debug version as well. |
1238cf3
to
7f7cf14
Compare
Yes it does switch to bulkwalk with version 2 and higher, of course we are using the gosnmp library for this functionality, not the snmpbulkwalk command. I added printing of gosnmp log messages to this branch. It is very verbose, so you must set |
Finally had some time to try out the latest build. It seems to run in a continuous loop when I execute it from the command line. There was nothing outputted in the console. |
Are you running it with |
@danielnelson I tried it again and it is outputting to the console. I must have forgotten the --test as you correctly pointed out. |
7f7cf14
to
62a66c8
Compare
closes #3263
Required for all PRs: