Add openconfig-snmp YANG model for SNMP configuration and monitoring#1486
Add openconfig-snmp YANG model for SNMP configuration and monitoring#1486nleiva wants to merge 5 commits into
Conversation
There was a problem hiding this comment.
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.
| leaf-list event-type { | ||
| type identityref { | ||
| base SNMP_NOTIFICATION_EVENT; | ||
| } | ||
| description | ||
| "Event types enabled for this specific receiver. | ||
| If empty, the receiver inherits the globally | ||
| configured event-type list under | ||
| notifications/config. If both are empty, no | ||
| notifications are sent. If the global list | ||
| contains ALL, all event types are sent unless | ||
| this receiver-level list restricts them to a | ||
| subset."; | ||
| } | ||
| } |
There was a problem hiding this comment.
The description states that the ALL identity should not be combined with other specific event types. This constraint should be enforced with a must statement to prevent invalid configurations.
leaf-list event-type {
type identityref {
base SNMP_NOTIFICATION_EVENT;
}
must "not(count(.) > 1 and . = 'oc-snmp:ALL')" {
error-message "Specific event types cannot be combined with ALL";
}
description
"Event types enabled for this specific receiver.
If empty, the receiver inherits the globally
configured event-type list under
notifications/config. If both are empty, no
notifications are sent. If the global list
contains ALL, all event types are sent unless
this receiver-level list restricts them to a
subset.";
}
| leaf-list event-type { | ||
| type identityref { | ||
| base SNMP_NOTIFICATION_EVENT; | ||
| } | ||
| description | ||
| "Globally enabled notification event types. | ||
| This list provides a default set of events for | ||
| all receivers. Individual receivers may override | ||
| this by specifying their own event-type list. | ||
| If ALL is included, all event types are enabled | ||
| globally; specific identities should not be | ||
| combined with ALL."; | ||
| } | ||
| } |
There was a problem hiding this comment.
Similar to the receiver-level configuration, the global event-type list should also enforce the exclusivity of the ALL identity using a must statement.
leaf-list event-type {
type identityref {
base SNMP_NOTIFICATION_EVENT;
}
must "not(count(.) > 1 and . = 'oc-snmp:ALL')" {
error-message "Specific event types cannot be combined with ALL";
}
description
"Globally enabled notification event types.
This list provides a default set of events for
all receivers. Individual receivers may override
this by specifying their own event-type list.
If ALL is included, all event types are enabled
globally; specific identities should not be
combined with ALL.";
}
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
/gcbrun |
|
No major YANG version changes in commit 84d2588 |
|
/gcbrun |
Change Scope
This PR adds a new YANG module
openconfig-snmpunderrelease/models/system/for managing SNMP services on network devices. The model covers community-based
SNMPv1/v2c configuration including:
SNMPv3 is explicitly out of scope for this module.
The module is imported by
openconfig-system.yangunder the system hierarchy.Platform Implementations
Tree View