infra for snmp support and linkUp/Down and Config change traps #225
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
Infra for snmp trap generation and support for linkUp/Down and Config change traps.
- How I did it
Trap infra provides a way to applications to register db keys changes interested and callback function that needs to be called on
db change.
- How to verify it
1)Configure snmp trap receiver
2)shut/noshut interface
- Description for the changelog
UT:
1)
config snmptrap modify 2 <trap_receiver_ip>
config vlan add 100
trap revived at receiver:
11:29:04.246743 IP (tos 0x0, ttl 64, id 18847, offset 0, flags [DF], proto UDP (17), length 103)
10.59.143.181.55851 > 10.59.142.44.162: [udp sum ok] { SNMPv2c { V2Trap(60) R=647415881 .1.3.6.1.2.1.1.3.0=13371 .1.3.6.1.6.3.1.1.4.1.0=.1.3.6.1.4.1.441
3.1.2.2.1.2.0.1 } }
config interface shutdown Ethernet0
Trap received at receiver:
11:33:20.007605 IP (tos 0x0, ttl 64, id 53955, offset 0, flags [DF], proto UDP (17), length 178)
10.59.143.181.55851 > 10.59.142.44.162: [udp sum ok] { SNMPv2c { V2Trap(133) R=647417338 .1.3.6.1.2.1.1.3.0=38947 .1.3.6.1.6.3.1.1.4.1.0=.1.3.6.1.6.3.1.
1.5.3 .1.3.6.1.2.1.2.2.1.1.1=1 .1.3.6.1.2.1.2.2.1.7.1=2 .1.3.6.1.2.1.2.2.1.8.1=2 .1.3.6.1.6.3.1.1.4.3.0=.1.3.6.1.4.1.8072.3.2.10 } }