I found an interesting behavior between walking using oid and tablename. We skipped the obsolete attributes when we auto-generate the mib class.
When we talk using oid of the table, it displays the attributes we put in value properly. However, when talking with mib table name, it tried to show the obsolete attributes and actual attributes that have data does not line up correctly. Hence, it resulted in invalid type. Is this an agent issue? How can we make the table walk work like oid?
table walk
$ snmpwalk -v2c -c public 127.0.0.1 DOCS-QOS-MIB::docsQosServiceFlowTable
DOCS-QOS-MIB::docsQosServiceFlowProvisionedParamSetIndex.3.6 = Gauge32: 6
DOCS-QOS-MIB::docsQosServiceFlowProvisionedParamSetIndex.3.8 = Gauge32: 8
DOCS-QOS-MIB::docsQosServiceFlowProvisionedParamSetIndex.3.8195 = Gauge32: 0
DOCS-QOS-MIB::docsQosServiceFlowProvisionedParamSetIndex.3.8196 = Gauge32: 0
DOCS-QOS-MIB::docsQosServiceFlowProvisionedParamSetIndex.4.4097 = Gauge32: 4097
DOCS-QOS-MIB::docsQosServiceFlowProvisionedParamSetIndex.4.12289 = Gauge32: 0
DOCS-QOS-MIB::docsQosServiceFlowAdmittedParamSetIndex.3.6 = Wrong Type (should be Gauge32 or Unsigned32): INTEGER: 2
DOCS-QOS-MIB::docsQosServiceFlowAdmittedParamSetIndex.3.8 = Wrong Type (should be Gauge32 or Unsigned32): INTEGER: 2
DOCS-QOS-MIB::docsQosServiceFlowAdmittedParamSetIndex.3.8195 = Wrong Type (should be Gauge32 or Unsigned32): INTEGER: 1
DOCS-QOS-MIB::docsQosServiceFlowAdmittedParamSetIndex.3.8196 = Wrong Type (should be Gauge32 or Unsigned32): INTEGER: 1
DOCS-QOS-MIB::docsQosServiceFlowAdmittedParamSetIndex.4.4097 = Wrong Type (should be Gauge32 or Unsigned32): INTEGER: 2
DOCS-QOS-MIB::docsQosServiceFlowAdmittedParamSetIndex.4.12289 = Wrong Type (should be Gauge32 or Unsigned32): INTEGER: 1
DOCS-QOS-MIB::docsQosServiceFlowActiveParamSetIndex.3.6 = Wrong Type (should be Gauge32 or Unsigned32): INTEGER: 1
DOCS-QOS-MIB::docsQosServiceFlowActiveParamSetIndex.3.8 = Wrong Type (should be Gauge32 or Unsigned32): INTEGER: 1
DOCS-QOS-MIB::docsQosServiceFlowActiveParamSetIndex.3.8195 = Wrong Type (should be Gauge32 or Unsigned32): INTEGER: 1
DOCS-QOS-MIB::docsQosServiceFlowActiveParamSetIndex.3.8196 = Wrong Type (should be Gauge32 or Unsigned32): INTEGER: 1
DOCS-QOS-MIB::docsQosServiceFlowActiveParamSetIndex.4.4097 = Wrong Type (should be Gauge32 or Unsigned32): INTEGER: 1
DOCS-QOS-MIB::docsQosServiceFlowActiveParamSetIndex.4.12289 = Wrong Type (should be Gauge32 or Unsigned32): INTEGER: 1
Hi,
If the skipping of the obsolete columns would have been successful during the code generation, there would not be any instance for that column. Instead, those obsolete columns have the wrong syntax (Integer32 instead Gauge32).
How did you suppress the generation of the obsolete columns? Using the skip=true should not generate the columns and there shouldn’t be any values returned for them.
The skipping was successful and those columns don’t exist in the mib class. What puzzles me is why when using the tablename for snmpwalk, those obsolete attributes displayed and not just displaying, it would try to map the value to the wrong column? Is this a display issue? or something serious?
yes we changed the template to use skip=true. Walk with oid looks fine, but we are not sure why walk with table name is not. Is there any log I can find out the issue.
The auto gen looks right. That’s why I am puzzled what went wrong.
// Column sub-identifier definitions for docsQosServiceFlowEntry:
public static final int colDocsQosServiceFlowSID = 3;
public static final int colDocsQosServiceFlowDirection = 4;
public static final int colDocsQosServiceFlowPrimary = 5;
// Column index definitions for docsQosServiceFlowEntry:
public static final int idxDocsQosServiceFlowSID = 0;
public static final int idxDocsQosServiceFlowDirection = 1;
public static final int idxDocsQosServiceFlowPrimary = 2;
OK, the agent is fine then - as you expected it.
The problem with the MIB based walk is the MIB you are using with the NET-SNMP tool. It seems to be a different version with a different column structure.
Normally, MIB specifications have to be written backward compatible (there is a standard for that) and MIBs must not shared OIDs.
At least one of these two rules have been ignored by the authors of your MIB or the one used by the NET-SNMP tool.
Thanks Frank. I want to make sure I understand this correctly.
This behavior could be caused by the MIB used by NET-SNMP tool is different from my current MIB. Or, my MIB is not backward compatible from the previous version. Is the above statement, correct?
If so, I have an additional question.
My MIB table still have the obsolete attributes defined in the Mib file, but I only have data for the non-obsolete in the agent. Could that cause the issues despite the MIB file is backward compatible?
Could it also be the NET-SNMP tool doesn’t do the correct mapping based on the field name and just display?
Your perception might be correct, that there is a bug in the NET-SNMP walk tool, because you explicitly walk a table. There might an incorrect optimisation implemented that does not check the returned OIDs correctly to resolve them to object names. Please specify the MIB without giving the table name but its parent node’s name. Maybe then the correct column names are displayed.
I am not quite sure if I did correctly on walking a table. Below are my tests.
I tried
$ snmpwalk -v2c -c public 127.0.0.1 DOCS-QOS-MIB
DOCS-QOS-MIB: Unknown Object Identifier (Sub-id not found: (top) -> DOCS-QOS-MIB)
I tried
$ snmpwalk -v2c -c public 127.0.0.1 DOCS-QOS-MIB::docsQosMIB
…
DOCS-QOS-MIB::docsQosParamSetBitMap.4.12289.active = BITS: F0 00 00 00 trafficPriority(0) maxTrafficRate(1) maxTrafficBurst(2) minReservedRate(3)
DOCS-QOS-MIB::docsQosServiceFlowProvisionedParamSetIndex.3.6 = Gauge32: 6
DOCS-QOS-MIB::docsQosServiceFlowProvisionedParamSetIndex.3.8 = Gauge32: 8
DOCS-QOS-MIB::docsQosServiceFlowProvisionedParamSetIndex.3.8195 = Gauge32: 0
DOCS-QOS-MIB::docsQosServiceFlowProvisionedParamSetIndex.3.8196 = Gauge32: 0
DOCS-QOS-MIB::docsQosServiceFlowProvisionedParamSetIndex.4.4097 = Gauge32: 4097
DOCS-QOS-MIB::docsQosServiceFlowProvisionedParamSetIndex.4.12289 = Gauge32: 0
DOCS-QOS-MIB::docsQosServiceFlowAdmittedParamSetIndex.3.6 = Wrong Type (should be Gauge32 or Unsigned32): INTEGER: 2
DOCS-QOS-MIB::docsQosServiceFlowAdmittedParamSetIndex.3.8 = Wrong Type (should be Gauge32 or Unsigned32): INTEGER: 2
DOCS-QOS-MIB::docsQosServiceFlowAdmittedParamSetIndex.3.8195 = Wrong Type (should be Gauge32 or Unsigned32): INTEGER: 1
DOCS-QOS-MIB::docsQosServiceFlowAdmittedParamSetIndex.3.8196 = Wrong Type (should be Gauge32 or Unsigned32): INTEGER: 1
DOCS-QOS-MIB::docsQosServiceFlowAdmittedParamSetIndex.4.4097 = Wrong Type (should be Gauge32 or Unsigned32): INTEGER: 2
DOCS-QOS-MIB::docsQosServiceFlowAdmittedParamSetIndex.4.12289 = Wrong Type (should be Gauge32 or Unsigned32): INTEGER: 1
DOCS-QOS-MIB::docsQosServiceFlowActiveParamSetIndex.3.6 = Wrong Type (should be Gauge32 or Unsigned32): INTEGER: 1
DOCS-QOS-MIB::docsQosServiceFlowActiveParamSetIndex.3.8 = Wrong Type (should be Gauge32 or Unsigned32): INTEGER: 1
DOCS-QOS-MIB::docsQosServiceFlowActiveParamSetIndex.3.8195 = Wrong Type (should be Gauge32 or Unsigned32): INTEGER: 1
DOCS-QOS-MIB::docsQosServiceFlowActiveParamSetIndex.3.8196 = Wrong Type (should be Gauge32 or Unsigned32): INTEGER: 1
DOCS-QOS-MIB::docsQosServiceFlowActiveParamSetIndex.4.4097 = Wrong Type (should be Gauge32 or Unsigned32): INTEGER: 1
DOCS-QOS-MIB::docsQosServiceFlowActiveParamSetIndex.4.12289 = Wrong Type (should be Gauge32 or Unsigned32): INTEGER: 1
DOCS-QOS-MIB::docsQosServiceFlowPkts.3.6 = Counter32: 0
DOCS-QOS-MIB::docsQosServiceFlowPkts.3.8 = Counter32: 0
…
I still see the “wrong type” output. If my walk incorrect, please let me know. Thanks
Hi Frank, Agnes,
Sorry that I just see this topic and realize it might be caused by my code change in template file.
I just deleted those ‘obsolete’ objects as below, and modified the ‘idx’ and ‘col’ values of un-obsolete objects.
Frank, would you please help to confirm about this:
If I define ‘new MOColumn[$columns.get($table).size()]’ and ‘idx’ / ‘col’ values for ‘obsolete’ objects as official template file does, and do not ‘genColumn($column)’ for the ‘obsolete’ objects, will there be errors triggered?