SNMP: Cisco Catalyst serial_number fallback when stack MIB serial is absent#23498
SNMP: Cisco Catalyst serial_number fallback when stack MIB serial is absent#23498
Conversation
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
🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 1c6cd04 | Docs | Datadog PR Page | Give us feedback! |
Made-with: Cursor
Made-with: Cursor
Validation ReportAll 20 validations passed. Show details
|
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?
| # Source 1: https://circitor.fr/Mibs/Html/CISCO-STACK-MIB.php | ||
| # Source 2: chassisSerialNumberString is present for this device: | ||
| # Cisco Systems WS-C6509.Cisco Catalyst Operating System Software, Version 5.5(8).Copyright (c) 1995-2001 by Cisco Systems. | ||
| MIB: CISCO-STACK-MIB |
There was a problem hiding this comment.
Can we keep MIB: field for both symbols?
There was a problem hiding this comment.
I could but why? symbol/symbols does not have a MIB field - they are just silently ignored. It was not mentioned in https://datadoghq.dev/integrations-core/tutorials/snmp/profile-format/#value-from-multiple-oids-symbols
If only for reference/documentation purposes, I did leave the MIB as a comment.
Summary
Catalyst device metadata
serial_numbershould usechassisSerialNumberString(CISCO-STACK-MIB) when that OID is present. This change only adds a second source:entPhysicalSerialNumat ENTITY-MIB1.3.6.1.2.1.47.1.1.1.1.11.1(index 1) so the Agent can still populateserial_numberwhenchassisSerialNumberStringdoes not exist on the device.Implementation:
_cisco-catalyst.yamluses an orderedsymbols:list (stack OID first, ENTITY OID second). The Agent uses the first symbol that returns a value at collection time.Scope
snmp/datadog_checks/snmp/data/default_profiles/_cisco-catalyst.yamlonly, plussnmp/changelog.d/23369.fixed.Testing
ddev --no-interactive test snmp(or targeted metadata tests) before ready for review.