Skip to content

improve(go.d/snmp): add manual_profiles option#21023

Merged
ilyam8 merged 4 commits intonetdata:masterfrom
ilyam8:improve-go.d-manual-profiles-opt
Sep 21, 2025
Merged

improve(go.d/snmp): add manual_profiles option#21023
ilyam8 merged 4 commits intonetdata:masterfrom
ilyam8:improve-go.d-manual-profiles-opt

Conversation

@ilyam8
Copy link
Member

@ilyam8 ilyam8 commented Sep 21, 2025

Summary

This PR adds a new configuration option, manual_profiles, to the SNMP collector.

Problem:

  • Some rare devices (e.g. certain printers) do not provide a sysObjectID, making it impossible to apply SNMP profiles automatically. Until now, these devices could not benefit from profile-based metric collection.

Solution:

  • Added manual_profiles config option (array of profile names).
  • Profile names should be given without file extensions (e.g. generic-device, not generic-device.yaml).
  • When sysObjectID is missing and no automatic match is possible, the collector falls back to applying the profiles specified in manual_profiles.
  • If both sysObjectID matching and manual_profiles are unavailable, no profiles are applied.
Test Plan
Additional Information
For users: How does this change affect me?

@ilyam8 ilyam8 requested a review from Copilot September 21, 2025 13:03
@github-actions github-actions bot added area/collectors Everything related to data collection collectors/go.d area/go labels Sep 21, 2025
Copy link
Contributor

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 adds a manual_profiles configuration option to the SNMP collector to enable profile-based metric collection for devices that don't provide a sysObjectID (such as certain printers).

  • Added manual_profiles array field to the Config struct for specifying fallback profiles
  • Modified profile selection logic to use manual profiles when sysObjectID is empty
  • Updated test cases and configuration examples to demonstrate the new functionality

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/go/plugin/go.d/collector/snmp/config.go Added ManualProfiles field to Config struct
src/go/plugin/go.d/collector/snmp/collect.go Updated profile setup to pass manual profiles parameter
src/go/plugin/go.d/collector/snmp/ddsnmp/profile.go Modified FindProfiles function to handle manual profile fallback logic
src/go/plugin/go.d/collector/snmp/ddsnmp/profile_test.go Added test case and updated function calls for manual profiles
src/go/plugin/go.d/collector/snmp/config_schema.json Added JSON schema definition for manual_profiles configuration
src/go/plugin/go.d/collector/snmp/testdata/config.yaml Added test configuration example
src/go/plugin/go.d/collector/snmp/testdata/config.json Added JSON test configuration example

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

ilyam8 and others added 3 commits September 21, 2025 16:15
@ilyam8 ilyam8 enabled auto-merge (squash) September 21, 2025 13:40
@ilyam8
Copy link
Member Author

ilyam8 commented Sep 21, 2025

cc @ralphm

@ilyam8 ilyam8 merged commit d1c4af6 into netdata:master Sep 21, 2025
105 checks passed
@ilyam8 ilyam8 deleted the improve-go.d-manual-profiles-opt branch September 21, 2025 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

3 participants