2

I am new to SNMP and need to develop a Windows Service that will make the discovery of devices (SNMP) for all network and then need to get the information from discovered devices.

The discovery of devices I could do, although I believe that some devices were not detected, but the problem now is to retrieve device information.

Anyone have any suggestions?

My discovering code:

    Discoverer _discoverer = new Discoverer();
    _discoverer.AgentFound += Discoverer_AgentFound;

    Console.WriteLine("v1 discovery");
    _discoverer.Discover(VersionCode.V1, new IPEndPoint(IPAddress.Broadcast, 161), new OctetString("public"), 6000);

    Console.WriteLine("v2 discovery");
    _discoverer.Discover(VersionCode.V2, new IPEndPoint(IPAddress.Broadcast, 161), new OctetString("public"), 6000);

    Console.WriteLine("v3 discovery");
    _discoverer.Discover(VersionCode.V3, new IPEndPoint(IPAddress.Broadcast, 161), null, 6000);

1 Answers1

0

SNMP RFC documents do not define a standard way of device discovery using SNMP. Thus, the Discoverer class of #SNMP uses a common approach to detect devices,

https://sharpsnmplib.codeplex.com/wikipage?title=SNMP%20Device%20Discovery

For security concerns, administrators might hide the devices by easily changing configuration. Generally speaking, you should manually add each devices instead.

Lex Li
  • 60,503
  • 9
  • 116
  • 147