0

I have been having many issues with trying to scan a range of ips for the specified Oid, like the Solarwinds Snmp Sweeper does. The reason why Solarwinds snmp tools lack is because they are too slow when checking larger ranges.

I am receiving a timeout error at about 62 hosts now. I am running a task factory to check each host in parallel to eachother. I am still recieving a timeout error. I noticed SharpSnmpNet has the same problem.

I believe being able to dispose the listener might help, because I think it is staying open even though it has received it's reply. This should not be happening but I believe it is because I am receiving multiple replies at the same time even though they have different target hosts.

How can I dispose the listener. Here is the only place I am calling sharpsnmp this is the function my tasks are executing.

Mr. Lex Li: I would be unbelievably grateful if you could reply:

public string ProcessData()
        {
            var receiver = new IPEndPoint(Ip, Config.Port);

            var vList = Config.SnmpOids.Select(item => new Variable(new ObjectIdentifier(item))).ToList();

            IList<Variable> vars = Messenger.Get(VersionCode.V2, receiver, new OctetString(Config.Community), vList,
                                                 Config.TimeOut);
            foreach (Variable variable in vars)
            {
                // Lets create a string based on our returned variable binding value.
                var outBuilder = new StringBuilder();

                if (!(variable.ToString().Contains("NoSuchObject")))
                {
                    outBuilder.Append(variable.Data + " ][ ");
                }

                string outPut = outBuilder.ToString();

                if (!(String.IsNullOrEmpty(outPut)))
                {
                    return outPut;
                    //Invoke our callback
                    //outputTree.BeginInvoke(new StringDelegate(UpdateScan), outPut, ip.ToString());
                    //txtFound.BeginInvoke(new StringDelegate(UpdateScan), 1);
                }
            }

            return null;
        }
user1632018
  • 2,485
  • 10
  • 52
  • 87
  • It seems that even when I manually add a listener event handler to a method that sends get requests with the proper endpoint ID, I still receive this issue. I am guessing that this is a limitation in Sharp SNMP Lib and SnmpSharpNet and will need to be fixed by plugging away at the libraries code. – user1632018 Apr 23 '14 at 06:00
  • Looping around a bunch of devices at the same time can easily lead to issues, which I could not reproduce on my personal machine. Thus, it is the users' responsibility to do further debugging instead of me. Remember both #SNMP and SNMP#NET are open source, so self-service debugging is a normal way to go. Microsoft provides System.NET tracing, while open source utilities such as Wireshark can show you the packets on the wire, so I think you have enough tips to get started. – Lex Li Apr 24 '14 at 03:03

0 Answers0