2

I was researching SNMPv3 for an internship and I got this code from snmpsharp.net (I couldn't show all of the code stackoverflow wouldn't let me)

using System;
using System.Net;
using SnmpSharpNet;
namespace SharpGetV3
{
    class MainClass
    {
       public static void Main(string[] args)
       {
           IpAddress ipa = new IpAddress("192.168.1.5");
           UdpTarget target = new UdpTarget((IPAddress)ipa);
           SecureAgentParameters param = new SecureAgentParameters();
           if (!target.Discovery(param))
           {
                Console.WriteLine("Discovery failed. Unable to continue...");
                target.Close();
                return;
           }

I couldn't get past the line

if(!target.Discoverey(param))

It gives me the error SnmpSharpNet.SnmpException: 'Request has reached maximum retries.'.What could be the cause of this?I could run SNMPv2 get requests just fine.Apologies if I can't answer your questions I'm still trying to understand how all this works.

MohammadAmin Mohammadi
  • 1,183
  • 3
  • 14
  • 23
Shizen
  • 21
  • 3
  • Use sniffer like wireshark of fiddler and get the HTTP Response which should be 200 OK (errors are usually 400 or 500). Make sure you use the latest version of API.Recently TLS 1.0 and TLS 1.1 are obsoleted by many servers and you have to use TLS 1.2. Also SNMP cannot be used in a corporate network with an outlook server. The port 587 is blocked at the Internet firewall and all 587 are forwarded to a Proxy Server that verifies credentials and sends all 587 to the corporate Outlook Server. You also want to make sure you meet all the following : http://www.snmp.com/snmpv3/snmpv3_intro.shtml – jdweng Jul 23 '20 at 09:48

0 Answers0