lextudio / sharpsnmplib

Sharp SNMP Library- Open Source SNMP for .NET
https://sharpsnmp.com
MIT License
356 stars 152 forks source link

UPS and SharpSNMPLib...? #677

Closed lextudio-support closed 2 hours ago

lextudio-support commented 3 hours ago

Hi,
I'm trying to get values from My UPS according to specification in MIB file RFC1628A.MIB. But always get Lextm.SharpSnmpLib.SharpTimeoutException from agent. any suggestions? We are now using SNMPDll implementation for C# and can read values from the same agent.

Original Reported Date: 2008-10-07T03:29:44.093-07:00 Original CodePlex Discussion Thread ID: 37191

lextudio-support commented 3 hours ago

Copied from CodePlex without authors:

OK I did a little debugging on actual SNMP packets send by #SNMP and SNMPDll. For same OID requested by #SNMP and SNMPDll libraries I get different packet lenght in bytes. Here is example:

This is SNMPDll request
Length = 43 bytes
30 29 02 01 00 04 06 70 75 62 6C 69 63 A0 1C 02
02 05 7C 02 01 00 02 01 00 30 10 30 0E 06 0A 2B
06 01 02 01 21 01 01 05 00 05 00

for this one i get response from agent!!!

This is the same request send by #SNMPlib
Length = 52 bytes
30 81 31 02 81 01 00 04 81 06 70 75 62 6C 69 63
A0 81 21 02 81 01 0A 02 81 01 00 02 81 01 00 30
81 12 30 81 0F 06 81 0A 2B 06 01 02 01 21 01 01
05 00 05 00

It can be noticed the after each Datatype byte additional bytes with value 0x81 is send....According to my SNMP packet specifications this is not OK. I new to this so it is possible that I'm wrong.

for this one i dont get response from agent!!!

Original Posted Date: 2008-10-08T04:09:12.763-07:00

lextudio-support commented 3 hours ago

Copied from CodePlex without authors:

Hi bvolkan,

I will check the source code to see if #SNMP generates the packet bytes correctly in your case. Update will be posted later.

-Lex

Original Posted Date: 2008-10-11T02:30:53.85-07:00

lextudio-support commented 3 hours ago

Copied from CodePlex without authors:

I am here again.

According to the byte analysis, I saw that you were using a relatively old build of #SNMP. Like you said it generated additional bytes which may be the cause of the problem (some SNMP agents cannot handle such packets correctly).

During the development of TwinTower Release, I have already improved the packet generation algorithm to remove those additional bytes. Thus, may you kindly test TwinTower RC2 (verion 1.5) here to see if it works fine?

http://www.codeplex.com/sharpsnmplib/Release/ProjectReleases.aspx?ReleaseId=15319

Thank you.

-Lex

Original Posted Date: 2008-10-11T19:39:23.2-07:00

lextudio-support commented 3 hours ago

Copied from CodePlex without authors:

Hi,
Can you assist me with decoding this message to find the community string and the OID

SNMP Message:
30 29 02 01 00 04 06 70 75 62 6c 69 63 a0 1c 02 04 4f 89 fb dd
02 01 00 02 01 00 30 0e 30 0c 06 08 2b 06 01 02 01 01 05 00 05 00

Original Posted Date: 2008-11-13T04:44:41.627-08:00

lextudio-support commented 2 hours ago

Copied from CodePlex without authors:

Hi,

This is a GET request message whose community string is public, and the OID is .1.3.6.1.2.1.1.5.0

By the way, next time may you initiate a new thread instead of appending in the end? :)

-Lex

Original Posted Date: 2008-11-14T17:05:14.437-08:00

lextudio-support commented 2 hours ago

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