14

I am trying to get SNMPv3 to work using sharpsnmplib but i am stuck on the discovery step.

 Discovery discovery = Messenger.GetNextDiscovery(SnmpType.GetRequestPdu);

 ReportMessage report = discovery.GetResponse(60000, new IPEndPoint(IPAddress.Parse(IPAddr), 161));

I was under the impression that the above code will send an empty request that would get the engineID and context from the device. But when looking at the result, it returns 1.3.6.1.6.3.15.1.1.4.0 which is usmStatsUnknownEngineIDs.

Error on Discovery

Am i missing something?

Kitson88
  • 2,889
  • 5
  • 22
  • 37
noisyass2
  • 580
  • 4
  • 13

1 Answers1

3

You have done nothing wrong, but simply some SNMP agents require the initial requests to contain a valid engine ID and they only respond to those valid requests.

That's the security configuration part, not caused by #SNMP.

Lex Li
  • 60,503
  • 9
  • 116
  • 147
  • 1
    I thought that is what the Discovery step is for. I do not think i can configure the device to not require an engineID. Also, i tried using a snmpsharpnet to the same device and discovery works as expected. I'd like to use your library though as it is open source. Care to point me in the right direction? – noisyass2 Feb 20 '17 at 02:04
  • If you get snmpsharpnet working, then compare the network packets. – Lex Li Feb 20 '17 at 02:13
  • @noisyass2 Could you please provide the method you are using to get it with snmpsharpnet? I am having the same issue with #SNMP, but snmpsharpnet not helping either. pl also refer to the question I have raised - https://stackoverflow.com/questions/53238825/snmp-v3-discovery-fails-using-snmpsharpnet – anil Nov 10 '18 at 13:10