-
Notifications
You must be signed in to change notification settings - Fork 6.1k
chore(go.d/snmp): load & merge per-vendor SNMP metadata overrides #20837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the SNMP metadata overrides system from a single YAML file to a multi-file layout organized by vendor. The system now loads and merges all *.yaml
/*.yml
files from a metadata directory in alphabetical order, with later files taking precedence on conflicts.
- Replaced single file loading with directory-based scanning and merging
- Added comprehensive merge logic for enterprise numbers, system object IDs, and category/model overrides
- Updated path resolution logic to locate the new metadata directory structure
Reviewed Changes
Copilot reviewed 28 out of 34 changed files in this pull request and generated 27 comments.
File | Description |
---|---|
src/go/plugin/go.d/pkg/snmputils/overrides.go | Core refactoring of loading logic to scan directory and merge multiple YAML files |
src/go/plugin/go.d/pkg/snmputils/overrides_test.go | Added test to verify all metadata YAMLs load and merge correctly |
src/go/plugin/go.d/config/go.d/snmp.profiles/metadata/*.yaml | New vendor-specific metadata files containing SNMP device overrides |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
…tdata#20837) (cherry picked from commit 6f41125)
Summary
This PR switches SNMP metadata overrides from a single YAML to a multi-file layout (one file per vendor + an “other” file) and updates the loader to read and merge all
*.yaml
|*.yml
files under the metadata directory.Split
meta_overrides.yaml
into vendor-scoped files (e.g.,cisco.yaml
,juniper.yaml
,hp.yaml
, …) plusother.yaml
.Test Plan
Additional Information
For users: How does this change affect me?