SNMP: extend Cisco serial_number coverage to Catalyst (incl. 1300/9200), cisco-sb, and add Catalyst 1300/9200 sysobjectids#23498
Conversation
🛑 Gate Violations
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files🚀 New features to boost your workflow:
|
victorsprengel
left a comment
There was a problem hiding this comment.
Could we also add coverage for the fallback oid in the existing unit tests?
1c6cd04 to
e5577fe
Compare
1d95565 to
6551dd3
Compare
|
@ian28223 , tests still failing 🙂 |
Adds the same one-line comment to _cisco-catalyst.yaml and cisco-sb.yaml so the CI test selector picks the same e2e tests as PR #23498. Lets us compare like-for-like on the e2e_core_profiles failures. No behavior change; not for merge.
d4891de to
611a2c1
Compare
@victorsprengel Took some time to rule out the E2E test failures. E2E tests failures are unrelated and to be addressed in #23706 The tests for this PR specifically did pass |
|
@ian28223 can you make sure CI is all green? |
@victorsprengel the CI failures are unrelated and to be addressed in #23706 |
Use metadata symbols (first fetchable wins) for CISCO-STACK-MIB chassisSerialNumberString and ENTITY-MIB entPhysicalSerialNum. Add Circitor MIB references, Source 2 sysDescr note, and stack index guidance. Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Adds a minimal cisco-catalyst-9k.snmprec fixture (no customer data) that exercises the entPhysicalSerialNum fallback when chassisSerialNumberString is absent, and asserts serial_number resolution via both a profile unit test and a core metadata test. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…sysobjectids Adds entPhysicalSerialNum.67109120 as the primary ENTITY-MIB fallback for Cisco devices that expose chassis data at the CBS350/Catalyst 1300 index, and keeps entPhysicalSerialNum.1 as the secondary fallback. - _cisco-catalyst.yaml: insert the .67109120 entry ahead of .1 in the serial_number symbols list so Catalyst 1300 and Cat 9400/9200 chassis (e.g. cisco_switch_c9407r) report a serial even when the legacy chassisSerialNumberString is absent. - _cisco-metadata.yaml: add the same fallback chain so profiles that inherit it (cisco.yaml via _base_cisco -> _cisco-generic) gain serial_number metadata. - cisco-sb.yaml: define serial_number with the same chain for CBS350 devices that fall outside the cisco-catalyst inheritance tree. - cisco-catalyst.yaml: add Catalyst 9200 (1.3.6.1.4.1.9.1.3079) and Catalyst 1300 (.3233, .3236) sysobjectids so those devices match the Catalyst profile. Refs AGENT-15682.
The cisco-sb, _cisco-metadata, and Catalyst 9200/1300 additions broaden the PR beyond the original Catalyst-only fallback intent.
The .67109120 index is only known on Catalyst 1300 / CBS-derived chassis; those devices match the cisco-catalyst profile, which keeps its own .67109120 lookup in _cisco-catalyst.yaml. Keeping .67109120 in the generic Cisco mixin adds noise without coverage benefit. Updates the changelog to reflect the narrower mixin scope.
Adding serial_number to _cisco-metadata.yaml turned out to suppress the leaf-level _cisco-catalyst.yaml symbols list during profile merging, so cisco-catalyst-profiled devices stopped extracting chassisSerialNumberString (the previously-working source). The metric mixin scope was already narrow benefit: the only known cisco_switch_1300 / c9407r devices now match cisco-catalyst directly, and the other inheritors of _cisco-metadata (cisco-firepower, cisco-firepower-asa, cisco-ironport-email) don't expose entPhysicalSerialNum in their test fixtures. Keep the entPhysicalSerialNum fallbacks in _cisco-catalyst.yaml and cisco-sb.yaml only.
Drops the Catalyst 9200 / 1300 sysobjectid entries (3079, 3233, 3236) from this branch; they ship in #23759 instead so the metadata fallback work here can be evaluated against CI in isolation.
This reverts commit 6551dd3.
The snmpsim container's entrypoint (datadog/docker-library:snmp) refuses to start if any .snmprec file isn't `sort -V | uniq` clean. Eight files in tests/compose/data had unsorted or duplicate OID rows, making the container exit immediately on boot and the agent collect zero metrics during e2e runs (`Needed at least 1 candidates for snmp.<metric>, got 0`). No content change other than line reordering; all OID/value pairs are preserved.
92b785a to
015b495
Compare
victorsprengel
left a comment
There was a problem hiding this comment.
Please rebase and make sure CI is green
Drops the broader entPhysicalSerialNum.1 fallback (entPhysicalIndex is arbitrary per ENTITY-MIB and .1 is not guaranteed to be the chassis). Keeps the documented .67109120 chassis index used by Catalyst 1300 / CBS-derived chassis. Test fixture renamed and re-targeted to a Catalyst 1300 sysObjectID (ciscoC130024P4G, 1.3.6.1.4.1.9.1.3233) so the snmprec models a device family where this index is actually valid. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Validation Report
Run Passed validations (20)
|
|
Closing in favor of #23939, which takes a different approach per the AGENT-15682 discussion: Catalyst 1200/1300 and CBS350 are routed to the cisco-sb profile (they run the SMB software stack, not IOS-XE) where the documented entPhysicalSerialNum.67109120 chassis index is read directly. No generic fallback in cisco-catalyst — entPhysicalIndex is arbitrary and an index-based fallback risked emitting non-chassis serials. For ciscoC9200CX12P2X2G (9.1.3079), the proper fix is dynamic chassis-row resolution (entPhysicalClass = chassis), which will be tracked as an FR. |
What does this PR do?
Adds an ENTITY-MIB fallback so the SNMP agent can populate Catalyst
serial_numberdevice metadata when the legacy CISCO-STACK-MIBchassisSerialNumberStringOID is absent on the device.Profile change (
_cisco-catalyst.yaml):The agent uses the first symbol that returns a non-empty value at collection time, so devices that still report the legacy OID are unaffected.
Test coverage:
test_cisco_catalyst_entity_serial_fallbackinsnmp/tests/test_profiles.pytest_e2e_core_metadata_cisco_catalyst_entity_serial_fallbackinsnmp/tests/test_e2e_core_metadata.pycisco-catalyst-1300.snmprecmodeling a Catalyst 1300 (sysObjectID 1.3.6.1.4.1.9.1.3233, ciscoC130024P4G) that exposes only the ENTITY-MIB fallback, no values that could identify a customer deviceMotivation
AGENT-15682: Cisco Catalyst devices that do not implement CISCO-STACK-MIB (e.g. Catalyst 1300 / CBS-derived chassis) currently surface no
serial_numberin device metadata, breaking downstream tagging and asset correlation.entPhysicalIndexis arbitrary per the ENTITY-MIB specification, so a generic fallback on index.1would risk emitting a non-chassis component's serial (PSU, fan, module) on platforms where index 1 is not the chassis. Index.67109120is the documented chassis row for Catalyst 1300 / CBS-derived chassis per Cisco's SMB switching OID reference, so the fallback is scoped to a device family where the index is stable and known.Customers on other Catalyst variants where index
.1is reliably the chassis can extend the profile in their own configuration to append additional fallback indexes without shipping that risk to all users.Review checklist (to be filled by reviewers)
qa/requiredif this PR needs QA validation, orqa/skip-qaif it does not. Exactly one of the two is required.backport/<branch-name>label to the PR and it will automatically open a backport PR once this one is merged