Skip to content

SNMP walk skips valid OID entries when an interface has missing counters #369

Description

@spandan-nexthop

When performing an SNMP walk (GETNEXT operations) over interface counter MIBs, if any interface lacks expected counters in COUNTERS_DB, the walk silently skips all subsequent valid entries and jumps to the next MIB subtree.

This is incorrect - a None value for one sub_id does not mean there are no more valid entries. The method should continue iterating to the next sub_id until a valid value is found or all entries are exhausted.

Steps to Reproduce

  1. Have a setup where some interfaces lack counter entries in COUNTERS_DB (e.g., ports that only have IN_DROPPED_PKTS and OUT_DROPPED_PKTS, or no counters at all)
  2. Ensure these counter-less interfaces appear in OID ordering before other valid interfaces (e.g., PortChannels)
  3. Perform an SNMP walk over an interface counter MIB (e.g., ifInDiscards)

The interfaces ordered after the counter-less ones will be missing from the walk results

cc: @anders-nexthop, @bhouse-nexthop

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions