Hello,
I use NET-SNMP version: 5.6 compiled myself for Arch Linux with ipv6 enabled.
I have trouble with understanding how Net-SNMP translates
InetAddressType/InetAddress OIDs.

1) I run walk on tcpConnectionState
snmpwalk -v 1 -c public localhost TCP-MIB::tcpConnectionState
(...)
TCP-MIB::tcpConnectionState.ipv4."192.168.85.92".49207.ipv4."192.168.85.53".22
= INTEGER: established(5)

2) I do the same with OID displayed numericaly
snmpwalk -O n -v 1 -c public localhost TCP-MIB::tcpConnectionState
(...)
.1.3.6.1.2.1.6.19.1.7.1.4.192.168.85.92.49207.1.4.192.168.85.53.22 =
INTEGER: established(5)

3) I try to get OID I received in step 1, it fails
snmpget -v 1 -c public localhost
TCP-MIB::tcpConnectionState.ipv4."192.168.85.92".49207.ipv4."192.168.85.53".22

TCP-MIB::tcpConnectionState.ipv4.192.168.85.92.49207.ipv4.192.168.85.53.22:
Unknown Object Identifier (Index out of range: 192
(tcpConnectionLocalAddress))

4) Now I try to get OID I received in step 2, it works
snmpget -v 1 -c public localhost
.1.3.6.1.2.1.6.19.1.7.1.4.192.168.85.92.49207.1.4.192.168.85.53.22
TCP-MIB::tcpConnectionState.ipv4."192.168.85.92".49207.ipv4."192.168.85.53".22
= INTEGER: established(5)

I found it while working on my code. For some reason Net-SNMP adds
size of the InetAddress when responds (snmpd), but not when sending
requests (snmpget). So snmpwalk returns values with size and snmpget
asks for values without size and they don't match.

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to