FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(go.d/snmp): reduce default MaxOIDs to 20 and remove 32-bit counter fallback by ilyam8 · Pull Request #22203 · netdata/netdata · GitHub

fix(go.d/snmp): reduce default MaxOIDs to 20 and remove 32-bit counter fallback - #22203

Merged
ilyam8 merged 1 commit into
netdata:masterfrom
ilyam8:fix/snmp-maxoids-and-counter-fallback
Apr 14, 2026
Merged

fix(go.d/snmp): reduce default MaxOIDs to 20 and remove 32-bit counter fallback#22203
ilyam8 merged 1 commit into
netdata:masterfrom
ilyam8:fix/snmp-maxoids-and-counter-fallback

Conversation

ilyam8 commented Apr 14, 2026
edited by cubic-dev-ai Bot
Loading

Copy link
Copy Markdown
Member
  • Lower default MaxOIDs from 60 to 20 for more reliable SNMP polling.
  • Remove 32-bit counter alternatives from IF-MIB virtual metrics to prevent counter type switching between collection cycles, which causes overflow due to mixing 32-bit and 64-bit counter values.
Summary
Test Plan
Additional Information
For users: How does this change affect me?

Summary by cubic

Reduced SNMP GET batch size and enforced 64-bit IF-MIB counters to improve polling reliability and prevent counter overflows.

  • Bug Fixes

    • Lowered default MaxOIDs from 60 to 20 for more reliable SNMP polling.
    • Removed 32-bit counter fallbacks for IF-MIB traffic and unicast packets to avoid type switching and overflow.
  • Migration

    • Devices without 64-bit ifXTable counters will no longer expose traffic/unicast metrics from IF-MIB.
    • You can override MaxOIDs in config if your devices handle larger batches.

Written for commit 617916b. Summary will update on new commits.

…r fallback

- Lower default MaxOIDs from 60 to 20 for more reliable SNMP polling.
- Remove 32-bit counter alternatives from IF-MIB virtual metrics to
  prevent counter type switching between collection cycles, which
  causes overflow due to mixing 32-bit and 64-bit counter values.

cubic-dev-ai Bot left a comment

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.
Architecture diagram
sequenceDiagram
    participant Config as Profile Configuration
    participant Collector as SNMP Collector
    participant Client as SNMP Client (gosnmp)
    participant Device as SNMP Device (Agent)

    Note over Collector,Device: Collection Cycle Started

    Collector->>Config: Load IF-MIB Metric Definitions
    Config-->>Collector: Return OIDs (64-bit HC counters only)

    Note over Collector: CHANGED: Batching logic now uses MaxOIDs=20 (down from 60)

    loop Every 20 OIDs
        Collector->>Client: Send GetRequest (Batch)
        Client->>Device: SNMP GET (PDU)
        
        alt Device supports requested OIDs
            Device-->>Client: Response (Success)
            Client-->>Collector: Return Variable Bindings
        else Device OID not found / Timeout
            Device-->>Client: Response (Error Status)
            Client-->>Collector: Return Error/Partial Data
        end
    end

    Note over Collector: Metric Processing (Virtual Metrics)

    alt NEW: Device has 64-bit counters (ifXTable)
        Collector->>Collector: Calculate ifTraffic (in/out)
        Collector->>Collector: Calculate ifPacketsUcast (in/out)
    else CHANGED: Device only has 32-bit counters (ifTable)
        Note over Collector: 32-bit fallback REMOVED for Traffic/Unicast
        Collector->>Collector: Skip Traffic/Unicast metrics (prevent overflow)
    end

    Collector->>Collector: Process 32-bit Errors/Discards (Still Supported)
    
    Note over Collector,Device: Collection Cycle Finished
Loading

Copilot AI left a comment

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pull request overview

This PR adjusts SNMP collector defaults and the standard IF-MIB profile to improve polling reliability and prevent counter-type switching (32-bit vs 64-bit) across collection cycles.

Changes:

  • Reduce the default options.max_request_size (MaxOIDs) from 60 to 20 in both schema and runtime defaults.
  • Remove 32-bit IF-MIB counter fallbacks from _std-if-mib.yaml virtual metrics (HC-only sources) and stop collecting the 32-bit octets/unicast OIDs.

Reviewed changes

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

File Description
src/go/plugin/go.d/config/go.d/snmp.profiles/default/_std-if-mib.yaml Disables 32-bit traffic/unicast counters and removes fallback alternatives so traffic metrics use HC-only counters.
src/go/plugin/go.d/collector/snmp/config_schema.json Lowers the documented schema default for options.max_request_size to 20.
src/go/plugin/go.d/collector/snmp/collector_test.go Updates test config helper to reflect the new default MaxOIDs.
src/go/plugin/go.d/collector/snmp/collector.go Updates runtime default MaxOIDs to 20.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ilyam8 merged commit 537fd8a into netdata:master Apr 14, 2026
165 of 167 checks passed
ilyam8 deleted the fix/snmp-maxoids-and-counter-fallback branch April 14, 2026 05:57
stelfrag pushed a commit to stelfrag/netdata that referenced this pull request Apr 14, 2026
stelfrag mentioned this pull request Apr 14, 2026
Ferroin pushed a commit that referenced this pull request Apr 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL