-
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
Unable to get SNMP plugin work with version 3 authentication #3655
Comments
What do you mean by external device, are you referring to another host on the same subnet or to a device on a routed network? There is a known issue where the response must be received from the same target host, I wonder if you are running into this: #3320 The logs seem to show what is going wrong, no response was received and request timeout, so I don't think they can be improved. |
Hi Danielnelson, By external device, i mean the device is not is our premises, it resides outside of our network. net-snmp and other tools like snmp-exporter + prometheus works fine with it. But through telegraf it doesn't work. Might be i am running into #3320, not sure, but yes it works through telegraf as well if i try to perform same things on any local/on premise device. Thanks, |
That is interesting that snmp-exporter is working, since we are both using the same gosnmp library. @phemmer do you have any idea what could cause this? |
Without seeing packet captures, not really. The only immediate thought is the default 5s timeout. |
@ashuw018 Do you think you could collect a packet dump? There is an example of how to do it on unix systems here https://github.com/soniah/gosnmp#packet-captures. It would be helpful to collect it once with @phemmer Do you think it would be useful if I wrote a clone of snmpget/snmpwalk using the gosnmp library? We could add debugging code as needed and then users could run this when they have a problem. |
Hi Daniel and Phemmer, Thanks for taking efforts. Here is another update from my end. This might change our investigation direction with this issue.. to me as of now snmpv2 is working and snmpv3 is not. Thanks, |
This might be gosnmp/gosnmp#95 |
Can you run a snmpwalk to your destination device from your telegraf server ? Do you see any output ? |
@rrasale Yes i do see valid output from snmpwalk over version 3. in fact using snmp exporter and prometheus it works perfect over snmpv3. |
Hi, I'm getting the same error. I can snmpwalk to the production server from my machine, but telegraf is returning request timeout. For example:
I'm running the official docker image of telegraf, which exposes the following ports:
SNMP plugin is configured as:
|
@glazzari Can you test with this field:
and save the capture with:
Capturing both commands would be helpful:
|
@danielnelson same results. I can snmpwalk correctly, but the plugins fails with request timeout.
|
Not sure if it's related to #3320. |
If the response source matches the request target then I don't think it is #3320 I notice that tcpdump reports the community name differently: - C="intcacti"
+ C="cintcacti" |
Good catch! I've just noticed the community name in telegraf.conf was including the 'c' as part of its name. This is probably a copy/paste error, because I was running snmpwalk with "-cintcacti" instead of "-c intcacti". Note the space after the "-c".
|
Did fixing that help? |
Yes! Thank you very much for your help. |
@ashuw018 Could you upload your working snmp_exporter configuration for comparison against the Telegraf plugin? |
@danielnelson Requested is attached. |
@ashuw018 Is this the agent you are unable to connect to? I notice the priv_protocl is DES while above in Telegraf it was set to AES.
|
Hi Daniel Thats just a typo while filling dummy data for posting. I am using AES in both. And tried with DES also. |
We also have the report about complex passwords causing problems, would it be possible to test, temporarily of course, if it helps to use a weak password with only ascii letters? |
Hi Daniel, Sorry for the delayed response. Actually we are going to testing phase with influxdb so the password were already kept simple. No character variations have been used. |
@phemmer Do you know if it is possible to collect packet captures of version 3? I assume we would need |
oh, hrm. It's been so long since I've worked with anything using v3 I'm not sure what the protocol looks like. But to be safe yes, |
@ashuw018 Would it be possible to use
BTW I looked through the snmp_exporter code for usage differences, but didn't see anything that stood out. |
@danielnelson I will reach to our NetSec support this Monday and will check if they can make such changes to get the required. If they allow me. I will definitely do that. Also is there any net snmp compatible command for above?. As i do not have any linux box out there. All are windows. Thanks. |
It should be possible to use this windows version: https://www.winpcap.org/windump/, though I have not tested it. You run the tcpdump command in one shell while in another you run the net-snmp command, then you stop the tcpdump command and it should print that it captured some packets. |
@danielnelson I approached to our support staff with this request but they denied to make config with NoAuthNoPriv as it is against there data center norms they said to me. Unfortunately in my local office i do not have any device which can snmp v3 so that i can get this tested here. |
Understandable, I will try to setup a v3 device for testing but it might take me awhile. |
Any update on this issue? I'm encountering the same problem. |
@cpajr I did do a sanity test using snmp v3 to a net-snmp server and didn't have any trouble. Are you also using Windows and what kind of device are you querying? |
@danielnelson I'm running on Centos 7, Telegraf v1.5.3. I'm trying to query a Cisco ASA via SNMPv3. Oddly enough, I'm able poll other Cisco devices via SNMPv3 but I'm only encountering issues with the ASA. I can successfully perform an snmpwalk without issue on the ASA. |
@cpajr Can you create a packet capture doing a snmpget and an equivalent query with Telegraf (with a single top level field). I think even with v3 security enabled it may be of some use, here is an example tcpdump:
Then upload these files along with your Telegraf snmp configuration (don't forget to remove your passwords or use a testing password). |
Hi Just FYI. |
@danielnelson I'll work to get this. It also appears that we have a commonality on the trouble device: Cisco ASA. |
I just found this gosnmp/gosnmp#108, I'll update our gosnmp dependency if you both can test it out. |
Let me know what needs to be updated and I will test it. |
Here are some builds with the updated gosnmp for testing: |
That did the trick. Thank you. |
I'll include this change in 1.6.0-rc3 |
Directions
I am trying to get telegraf working with SNMP plugin, everything works fine if the device ip in agent section is local network IP, but it does not work if i try same with any external networks device IP.
**Everything is working with snmpwalk, snmptable with local and external network device, but through telegraf it doesn't work for external device.
Relevant telegraf.conf:
[[inputs.snmp]]
agents = [ "x.x.x.x:161" ]
version = 3
sec_name = "myuser"
auth_protocol = "SHA"
auth_password = "my_Auth"
sec_level = "authPriv"
context_name = ""
priv_protocol = "AES"
priv_password = "my_PWD"
name = "system"
[[inputs.snmp.field]]
name = "hostname"
oid = "RFC1213-MIB::sysName.0"
is_tag = true
[[inputs.snmp.table]]
name = "snmp"
inherit_tags = [ "hostname" ]
oid = "IF-MIB::ifXTable"
System info:
Telegraf version = v1.5.0
Net snmp
Windows 10 and windows 2008 R2
Steps to reproduce:
Expected behavior:
It should work as it is working with local network devices
Actual behavior:
It is working with local device but not with external device, also it should give some exact logs that exactly whats going wrong.
Additional info:
Errors which i am getting
2018-01-09T09:19:24Z E! Error in plugin [inputs.snmp]: agent x.x.x.x:161: performing get on field hostname: Request timeout (after 3 retries)
2018-01-09T09:19:34Z E! Error in plugin [inputs.snmp]: agent x.x.x.x:161: gathering table snmp: performing bulk walk for field ifName: Request timeout (after 3 retries)
The text was updated successfully, but these errors were encountered: