-
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
SNMP Table input fails on Windows #3263
Comments
I wonder if this is a permissions or environment issue, how are you running telegraf? |
Telegraf is running a windows service as per documentation. If I comment out just the [[inputs.snmp.table]] section telegraf will get the other SNMP values properly. Also like I mentioned, I'm pretty sure it's failing when calling snmpwalk to get the headers, since the error message happens right after that check. |
I just tried in another environment with another network device and I get the same error. I believe it's the way Go is wrapping and calling the net-snmp commands. BTW, yes the net-snmp commands work properly since I can call |
Same here on a windows 10 64 bit system: |
I did a little investigation and it appears that this is caused by DOS line endings in the command output in Windows. |
Thanks @danielnelson, would you know of a temporary workaround or do we have to wait till this bug is corrected? |
I put part of the logic in a little test program:
And this doesn't trigger the error part. |
@pstatho You might be able to create a wrapper script that converts to unix line endings, and wrap both snmptranslate and snmptable. I haven't tried this so I'm not sure if it will work. @RubenN It is not actually a problem with running the commands, but with parsing the output. When we parse the oidText here it has a trailing |
@danielnelson the line parsing does sound like it's the issue. I suppose using ReadLine() instead would make it cross-platform. BTW, it's also used on several other lines like 850 and 877 and 970 |
Bug report
SNMP Table input fails on Windows.
Relevant telegraf.conf:
System info:
Telegraf v1.4 on Windows 2012R2
Steps to reproduce:
Expected behavior:
SNMP Table info is collected and sent to InfluxDB
Actual behavior:
SNMP plugin fails to collect table data
Additional info:
Log file contains the following error:
I believe the error is occurring on line 876 of snmp.go file. My understanding is that it is running the command:
When I run that command from the command line, it returns the table columns and I checked the exit code which is 0.
Use case: [Why is this important (helps with prioritizing requests)]
Pretty important for Windows sysadmins to use TICK to collect SNMP data in an office environment
The text was updated successfully, but these errors were encountered: