snmpagent: Implement an asyncio-based SNMP trap infrastructure supporting link up/down, PSU, and fan traps - #366
Open
Griffin-micas wants to merge 1 commit into
Conversation
|
|
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Griffin-micas
force-pushed
the
add-linkupdown-psu-fan-trap
branch
from
February 5, 2026 07:02
5c40128 to
5449e15
Compare
Collaborator
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Author
|
@qiluo-msft Hi Qiluo, could you please take a look at this PR when you have time? Thanks! |
Griffin-micas
force-pushed
the
add-linkupdown-psu-fan-trap
branch
from
July 17, 2026 06:34
5449e15 to
1e10e89
Compare
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
…ting link up/down, PSU, and fan traps Signed-off-by: Griffin Gao <griffin@micasnetworks.com>
Griffin-micas
force-pushed
the
add-linkupdown-psu-fan-trap
branch
from
July 17, 2026 08:30
1e10e89 to
0d1778d
Compare
Collaborator
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Collaborator
|
This PR has backport request for branch(es): 202511. ---Powered by SONiC BuildBot
|
Collaborator
|
Hi, there are workflow run(s) waiting for approval, you may be first-time contributor. I will notify maintainers to help approve once PR is approved. Thanks! ---Powered by SONiC BuildBot
|
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
- What I did
- How I did it
Introduced a generic TrapInfra layer that:
Implemented dedicated trap handlers:
All handlers compute varbinds based on state transitions, not raw field updates.
TrapInfra lifecycle is fully asyncio-managed and supports graceful shutdown.
- How to verify it
Link state change (config interface shutdown/startup)
PSU or FAN state change (hardware event or simulated Redis update)
SNMP notifications are sent as v1/v2c Notifications.
snmpTrapOID.0 matches the expected trap OID.
Varbind values (ifIndex, ifOperStatus, PSU/FAN status) are correct.
No duplicate traps are generated without actual semantic state changes.
- Description for the changelog
Add asyncio-based SNMP trap infrastructure with native support for link and PSU/FAN notifications.
Which release branch to backport (provide reason below if selected)
Reason for backport:
This change provides standard SNMP trap support (link, PSU, and FAN), which is required for basic device monitoring and NMS integration.
The implementation is self-contained, does not change existing SNMP behavior unless traps are explicitly configured, and is safe to include in 202511 releases.