IpNetToMediaTable query (was Re: [SNMP4J] please help...)

Jacek Tobiasz Jacek.Tobiasz at atm.com.pl
Tue Apr 18 17:27:52 CEST 2006


dvd at gazeta.pl wrote:
> Thanks Jacek, but the problem is not solved.
> Your tip is quite nice, I didn't know that ipNetToMediaEntry table
> has got 2 indexes. Your guess is correct - I use GET instead of
> GETNEXT. 

it was the first tip ...

> However if I want to read some informations from the other tables in
> IP mib, eg. ipAddrTable (1 index) the null is in the response.

second tip follows ...

> I've just tried to read ipAdEntAddr so I sent GET request for
> objects like: 1.3.6.1.2.1.4.20.1.1.1.0, 1.3.6.1.2.1.4.20.1.1.1,
> 1.3.6.1.2.1.4.20.1.1, 1.3.6.1.2.1.4.20.1.1.0 and there was always
> 'no such object found'.

works as designed, there is no such object for GET 1.3.6.1.2.1.4.20.1.1.1.0 ...

ipAddrTable is indexed with ipAdEntAddr and IP-MIB says:

ipAdEntAddr OBJECT-TYPE
     SYNTAX      IpAddress
[...]

so, the index has syntax IpAddress as defined in SNMPv2-SMI.

In case of your GET 1.3.6.1.2.1.4.20.1.1.1.0, you are asking about
entry with IpAddress == 1.0 - it does not look like a valid IP address,
right ?

ipAddrEntry = 1.3.6.1.2.1.4.20.1
ipAdEntAddr = 1.3.6.1.2.1.4.20.1.1

your OID is ipAdEntAddr + 1.0

Forget about GET and use GETNEXT starting with ipAdEntAddr,
or even better start with command line snmpget/snmpgetnext or
any MIB browser and *read* the MIB files !

Example (old net-snmp version of snmp tools):

 >snmpwalk ip.ip.ip.ip community .1.3.6.1.2.1.4.20.1.1
ip.ipAddrTable.ipAddrEntry.ipAdEntAddr.10.130.0.1 = IpAddress: 10.130.0.1

 >snmpwalk -On ip.ip.ip.ip community .1.3.6.1.2.1.4.20.1.1
.1.3.6.1.2.1.4.20.1.1.10.130.0.1 = IpAddress: 10.130.0.1

 >snmpget -On ip.ip.ip.ip community .1.3.6.1.2.1.4.20.1.1
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: .1.3.6.1.2.1.4.20.1.1

 >snmpgetnext -On ip.ip.ip.ip community .1.3.6.1.2.1.4.20.1.1
.1.3.6.1.2.1.4.20.1.1.10.130.0.1 = IpAddress: 10.130.0.1

 >snmpget -On ip.ip.ip.ip community .1.3.6.1.2.1.4.20.1.1.10.130.0.1
.1.3.6.1.2.1.4.20.1.1.10.130.0.1 = IpAddress: 10.130.0.1


snmpwalk/snmpget/snmpgetnext is your friend  here...

Regards,
Jacek



More information about the SNMP4J mailing list