lextudio / sharpsnmplib

C# SNMP Library (#SNMP) - Open source SNMP implementation for C# and .NET
https://sharpsnmp.com
MIT License
358 stars 151 forks source link

Port problem #651

Closed lextudio-support closed 1 month ago

lextudio-support commented 1 month ago

Dear Sirs,

If I use this:

Dim test1 As Variable = New Variable(New ObjectIdentifier(New System.UInt32() {1, 3, 6, 1, 4, 1, 17491, 2, 1, 4, 1, 2, 0}))
Dim variable1 As Variable = manager.Get(IPAddress.Parse(LREPIP),1610, "private", test1)

It is not possbile to Compile because manager.Get doe's not handle so many attributes.

Could you tell me how I could built in the another Port Feature?

Thank you so much,

Best regards,

Original Reported Date: 2009-07-15T04:18:20.1-07:00 Original CodePlex Discussion Thread ID: 62485

lextudio-support commented 1 month ago

Copied from CodePlex without authors:

   Socket objSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);

    IPAddress objAddress = IPAddress.Parse("IPAddress");
            IPEndPoint objEndPoint = new IPEndPoint(objAddress, 161);
            Lextm.SharpSnmpLib.OctetString objCommunity = new Lextm.SharpSnmpLib.OctetString("public");

            List<Lextm.SharpSnmpLib.Variable> objInput = new List<Lextm.SharpSnmpLib.Variable>();

            objInput.Add(new Lextm.SharpSnmpLib.Variable(new Lextm.SharpSnmpLib.ObjectIdentifier("1.3.6.1.4.1.3711.24.1.1.1.2.2.1.6")));

            Lextm.SharpSnmpLib.GetRequestMessage message = new Lextm.SharpSnmpLib.GetRequestMessage(1,
                Lextm.SharpSnmpLib.VersionCode.V2, objCommunity, objInput);

            Lextm.SharpSnmpLib.ISnmpMessage response = message.GetResponse(10000, objEndPoint, objSocket);

            string Value = response.Pdu.Variables[0].Data.ToString();

You can try this way

Original Posted Date: 2009-07-16T04:37:20.66-07:00

lextudio-support commented 1 month ago

Marked as Answer Date: 2013-10-06T21:25:59.307-07:00