Skip to content

Add openconfig-snmp YANG model for SNMP configuration and monitoring#1486

Open
nleiva wants to merge 6 commits into
openconfig:masterfrom
nleiva:master
Open

Add openconfig-snmp YANG model for SNMP configuration and monitoring#1486
nleiva wants to merge 6 commits into
openconfig:masterfrom
nleiva:master

Conversation

@nleiva

@nleiva nleiva commented May 5, 2026

Copy link
Copy Markdown
Contributor

Change Scope

This PR adds a new YANG module openconfig-snmp under release/models/system/
for managing SNMP services on network devices. The model covers community-based
SNMPv1/v2c configuration including:

  • Global SNMP settings (contact, location)
  • Community definitions with access modes (read-only, read-write)
  • Client prefix restrictions per community
  • Trap/notification receivers
  • Notification event filtering (authentication, line-status, etc.)

SNMPv3 is explicitly out of scope for this module.

The module is imported by openconfig-system.yang under the system hierarchy.

Platform Implementations

Tree View

module: openconfig-system
  +--rw system
     ...
     +--rw snmp
        +--rw config
        |  +--rw contact?    string
        |  +--rw location?   string
        +--ro state
        |  +--ro contact?    string
        |  +--ro location?   string
        +--rw communities
        |  +--rw community* [name]
        |     +--rw name            -> ../config/name
        |     +--rw config
        |     |  +--rw name?          string
        |     |  +--rw access-mode?   snmp-access-mode
        |     |  +--rw version?       snmp-version
        |     +--ro state
        |     |  +--ro name?          string
        |     |  +--ro access-mode?   snmp-access-mode
        |     |  +--ro version?       snmp-version
        |     +--rw managers
        |     |  +--rw manager* [prefix]
        |     |     +--rw prefix    -> ../config/prefix
        |     |     +--rw config
        |     |     |  +--rw prefix?   oc-inet:ip-prefix
        |     |     +--ro state
        |     |        +--ro prefix?   oc-inet:ip-prefix
        |     +--rw access-lists
        |        +--rw access-list* [name type]
        |           +--rw name      -> ../config/name
        |           +--rw type      -> ../config/type
        |           +--rw config
        |           |  +--rw name?   -> /oc-acl:acl/acl-sets/acl-set/config/name
        |           |  +--rw type?   -> /oc-acl:acl/acl-sets/acl-set[oc-acl:name=current()/../name]/config/type
        |           +--ro state
        |              +--ro name?   -> /oc-acl:acl/acl-sets/acl-set/config/name
        |              +--ro type?   -> /oc-acl:acl/acl-sets/acl-set[oc-acl:name=current()/../name]/config/type
        +--rw notifications
           +--rw config
           |  +--rw event-type*   identityref
           +--ro state
           |  +--ro event-type*   identityref
           +--rw receivers
              +--rw receiver* [name]
                 +--rw name      -> ../config/name
                 +--rw config
                 |  +--rw name?                string
                 |  +--rw address?             oc-inet:ip-address
                 |  +--rw port?                oc-inet:port-number
                 |  +--rw version?             snmp-version
                 |  +--rw community?           string
                 |  +--rw notification-type?   snmp-notification-type
                 |  +--rw event-type*          identityref
                 +--ro state
                    +--ro name?                    string
                    +--ro address?                 oc-inet:ip-address
                    +--ro port?                    oc-inet:port-number
                    +--ro version?                 snmp-version
                    +--ro community?               string
                    +--ro notification-type?       snmp-notification-type
                    +--ro event-type*              identityref
                    +--ro notifications-sent?      yang:counter64
                    +--ro notifications-dropped?   yang:counter64

@nleiva nleiva requested a review from a team as a code owner May 5, 2026 13:22

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces the openconfig-snmp module for community-based SNMP configuration and state, integrating it into the system model. Feedback identifies that the snmp-top grouping is not yet instantiated in the system container and that the access-list reference is ambiguous because it lacks the ACL type required for the composite key. Suggestions were also made to use oc-inet:port-number with a default value for notification ports and to add must statements to prevent combining the 'ALL' event type with specific identities.

Comment thread release/models/system/openconfig-system.yang
Comment thread release/models/system/openconfig-snmp.yang
Comment thread release/models/system/openconfig-snmp.yang
Comment thread release/models/system/openconfig-snmp.yang
Comment thread release/models/system/openconfig-snmp.yang Outdated
nleiva and others added 3 commits May 5, 2026 09:34
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@ElodinLaarz

Copy link
Copy Markdown
Contributor

/gcbrun

@OpenConfigBot

OpenConfigBot commented May 5, 2026

Copy link
Copy Markdown

No major YANG version changes in commit c4f24eb

Comment thread release/models/system/openconfig-snmp.yang Outdated
Comment thread release/models/system/openconfig-snmp.yang Outdated
Comment thread release/models/system/openconfig-snmp.yang Outdated
Comment thread release/models/system/openconfig-snmp.yang
@dplore

dplore commented May 12, 2026

Copy link
Copy Markdown
Member

/gcbrun

@dplore dplore moved this to Ready to discuss in OC Operator Review May 12, 2026
Comment thread release/models/system/openconfig-snmp.yang Outdated
@nleiva nleiva requested a review from fenner June 2, 2026 12:50
@navaneethyv

Copy link
Copy Markdown

/gcbrun

@navaneethyv

Copy link
Copy Markdown

Discussed on June 2nd , moving to the last call

@nleiva nleiva moved this from Ready to discuss to last-call in OC Operator Review Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: last-call

Development

Successfully merging this pull request may close these issues.

6 participants