Skip to content

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

Merged
merged 2 commits into from
Aug 18, 2025

Conversation

ilyam8
Copy link
Member

@ilyam8 ilyam8 commented Aug 18, 2025

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, …) plus other.yaml.

Test Plan
Additional Information
For users: How does this change affect me?

@ilyam8 ilyam8 requested review from vkalintiris and a team as code owners August 18, 2025 12:40
@ilyam8 ilyam8 requested review from Copilot and removed request for a team and vkalintiris August 18, 2025 12:40
@github-actions github-actions bot added area/collectors Everything related to data collection area/build Build system (autotools and cmake). collectors/go.d area/go labels Aug 18, 2025
Copy link
Contributor

@Copilot Copilot AI left a 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.

stelfrag
stelfrag previously approved these changes Aug 18, 2025
@ilyam8 ilyam8 enabled auto-merge (squash) August 18, 2025 13:19
@ilyam8 ilyam8 merged commit 6f41125 into netdata:master Aug 18, 2025
103 of 106 checks passed
@ilyam8 ilyam8 deleted the chore-go.d-snmp-meta-split branch August 18, 2025 14:08
stelfrag pushed a commit to stelfrag/netdata that referenced this pull request Aug 19, 2025
@stelfrag stelfrag mentioned this pull request Aug 19, 2025
Ferroin pushed a commit that referenced this pull request Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build Build system (autotools and cmake). area/collectors Everything related to data collection area/go collectors/go.d
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants