Skip to content

SNMP: Cisco Catalyst serial_number fallback when stack MIB serial is absent#23498

Open
ian28223 wants to merge 4 commits intomasterfrom
ian.bucad/cisco-catalyst-serial-number-metadata
Open

SNMP: Cisco Catalyst serial_number fallback when stack MIB serial is absent#23498
ian28223 wants to merge 4 commits intomasterfrom
ian.bucad/cisco-catalyst-serial-number-metadata

Conversation

@ian28223
Copy link
Copy Markdown
Contributor

@ian28223 ian28223 commented Apr 28, 2026

Summary

Catalyst device metadata serial_number should use chassisSerialNumberString (CISCO-STACK-MIB) when that OID is present. This change only adds a second source: entPhysicalSerialNum at ENTITY-MIB 1.3.6.1.2.1.47.1.1.1.1.11.1 (index 1) so the Agent can still populate serial_number when chassisSerialNumberString does not exist on the device.

Implementation: _cisco-catalyst.yaml uses an ordered symbols: 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.yaml only, plus snmp/changelog.d/23369.fixed.

Testing

  • ddev --no-interactive test snmp (or targeted metadata tests) before ready for review.

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
@ian28223 ian28223 changed the title SNMP: Cisco Catalyst serial_number uses ordered MIB fallbacks SNMP: Cisco Catalyst serial_number fallback when stack MIB serial is absent Apr 28, 2026
@datadog-prod-us1-4
Copy link
Copy Markdown
Contributor

datadog-prod-us1-4 Bot commented Apr 28, 2026

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 95.38% (+8.24%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 1c6cd04 | Docs | Datadog PR Page | Give us feedback!

@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented Apr 28, 2026

Validation Report

All 20 validations passed.

Show details
Validation Description Status
agent-reqs Verify check versions match the Agent requirements file
ci Validate CI configuration and Codecov settings
codeowners Validate every integration has a CODEOWNERS entry
config Validate default configuration files against spec.yaml
dep Verify dependency pins are consistent and Agent-compatible
http Validate integrations use the HTTP wrapper correctly
imports Validate check imports do not use deprecated modules
integration-style Validate check code style conventions
jmx-metrics Validate JMX metrics definition files and config
labeler Validate PR labeler config matches integration directories
legacy-signature Validate no integration uses the legacy Agent check signature
license-headers Validate Python files have proper license headers
licenses Validate third-party license attribution list
metadata Validate metadata.csv metric definitions
models Validate configuration data models match spec.yaml
openmetrics Validate OpenMetrics integrations disable the metric limit
package Validate Python package metadata and naming
readmes Validate README files have required sections
saved-views Validate saved view JSON file structure and fields
version Validate version consistency between package and changelog

View full run

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.01%. Comparing base (47ac5cc) to head (1c6cd04).
⚠️ Report is 92 commits behind head on master.

Additional details and impacted files
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@victorsprengel victorsprengel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep MIB: field for both symbols?

Copy link
Copy Markdown
Contributor Author

@ian28223 ian28223 May 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

https://github.com/DataDog/datadog-agent/blob/9f24ee816b26464ca4db0e1e2b56b5deb6ca6893/pkg/networkdevice/profile/profiledefinition/metrics.go#L66-L88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants