After I generated agent code using mib2c I am able to walk the entire table however, trying to access indexes, snmpwalk application tells me that the value provided is out of range. This only happens when my indexes are of type OCTET STRING. Modifying the MIB and replacing String indexes with type integer everything seems to be working. I have used mfd.conf configuration to mib2c to generate C code.
using STRING indexes:
LIB-SNMP-MIB::hostname."arrow"."lib.com" = STRING: arrow
LIB-SNMP-MIB::hostname."volta"."vmod.com" = STRING: volta
LIB-SNMP-MIB::hostname."einstein"."cable.com" = STRING: einstein
LIB-SNMP-MIB::instance."arrow"."lib.com" = STRING: liberate.com
LIB-SNMP-MIB::instance."volta"."vmod.com" = STRING: vmodem.com
LIB-SNMP-MIB::instance."einstein"."cable.com" = STRING: cableshare.com
LIB-SNMP-MIB::pRead."arrow"."lib.com" = STRING: oneRead
LIB-SNMP-MIB::pRead."volta"."vmod.com" = STRING: threeRead
LIB-SNMP-MIB::pRead."einstein"."cable.com" = STRING: twoRead
LIB-SNMP-MIB::pWrite."arrow"."lib.com" = STRING: oneWrite
LIB-SNMP-MIB::pWrite."volta"."vmod.com" = STRING: threeWrite
LIB-SNMP-MIB::pWrite."einstein"."cable.com" = STRING: twoWrite
running
snmpget -v 2c -c libcomm localhost LIB-SNMP-MIB::"hostname."arrow"."lib.com""
produces error:
hostname.arrow.lib.com: Unknown Object Identifier (Index out of range: arrow (hostname))
using INTEGER indexes:
LIB-SNMP-MIB::hostIdx.0.0 = INTEGER: 0
LIB-SNMP-MIB::hostIdx.0.1 = INTEGER: 0
LIB-SNMP-MIB::hostIdx.0.2 = INTEGER: 0
LIB-SNMP-MIB::instanceIdx.0.0 = INTEGER: 0
LIB-SNMP-MIB::instanceIdx.0.1 = INTEGER: 1
LIB-SNMP-MIB::instanceIdx.0.2 = INTEGER: 2
LIB-SNMP-MIB::hostname.0.0 = STRING: arrow
LIB-SNMP-MIB::hostname.0.1 = STRING: volta
LIB-SNMP-MIB::hostname.0.2 = STRING: einstein
LIB-SNMP-MIB::instance.0.0 = STRING: lib.com
LIB-SNMP-MIB::instance.0.1 = STRING: cable.com
LIB-SNMP-MIB::instance.0.2 = STRING: vmod.com
LIB-SNMP-MIB::pRead.0.0 = STRING: oneRead
LIB-SNMP-MIB::pRead.0.1 = STRING: twoRead
LIB-SNMP-MIB::pRead.0.2 = STRING: threeRead
LIB-SNMP-MIB::pWrite.0.0 = STRING: oneWrite
LIB-SNMP-MIB::pWrite.0.1 = STRING: twoWrite
LIB-SNMP-MIB::pWrite.0.2 = STRING: threeWrite
running
snmpget -v 2c -c libcomm localhost LIB-SNMP-MIB::hostname.0.0
produces expected result: "arrow"
Any help would be greatly appreciated.
Przemek Struminski