03-25-2020 10:42 AM
Hi Community,
We have configured SNMP on a couple of Nexus 9k. All devices are using the same SNMP config.
The monitoring system is able to poll all the devices and also generate network map with all active connections, so communication seems ok.
However only 2 of the devices are able to send traps ( the NMS is receiving traps only from these 2 devices). There is no trap(not even any log in tcpdump) when making a test like up/down an interface(I am not sure if this generates a trap)
Is there a test trap to be simulated in order to check if the NMS can get?
Also on the SNMP configuration, I try to enable snmp-server traps link. The command is accepted but it is not showing on the running-config.
Thanks in advance,
Nikola
Solved! Go to Solution.
03-26-2020 05:13 PM
A non-disruptive test could be trapping on a feature change. In this example here I'll use `feature bash` which enabled/disabled the BASH shell. First check to see what state you have the feature in (on/off). There should be no disruption turning this feature on/off but I would always recommended to do it during a window/quiet time.
Leaf-9(config)# snmp-server enable traps feature-control FeatureOpStatusChange Leaf-9(config)#
! Check if feature is currently enabled/disabled (it's on in my case)Leaf-9(config)# show feature | i i bash
bash-shell 1 enabled
Leaf-9(config)# no feature bash
Leaf-9(config)#
Leaf-9# ethanalyzer local interface mgmt display-filter "snmp" limit-cap 0
Capturing on mgmt0
2020-03-27 11:11:13.775465 10.66.50.37 -> 192.0.2.1 SNMP trap iso.3.6.1.4.1.9.9.377 1.3.6.1.4.1.9.9.377.1.1.2.1.8.153.1
03-26-2020 02:49 AM - edited 03-26-2020 02:58 AM
Hi Nikola,
I just did a quick test in my lab
Leaf-9(config)# show run snmp !Command: show running-config snmp [ snip ] snmp-server host 192.0.2.1 traps version 1 public snmp-server host 192.0.2.1 source-interface mgmt0 [ snip ]
! ! Change mgmt -> inband if you're not using mgmt0, VRF management for traps
! To stop the output hit ctrl + c
! If you want a more specific filter you can use display-filter "snmp && ip.addr==a.b.c.d"
! Leaf-9(config)# ethanalyzer local interface mgmt display-filter "snmp" limit-cap 0 Capturing on mgmt0 2020-03-26 20:40:06.137982 10.66.50.37 -> 192.0.2.1 SNMP trap iso.3.6.1.4.1.9.9.276 1.3.6.1.2.1 .2.2.1.1.436207616 1.3.6.1.2.1.2.2.1.7.436207616 1.3.6.1.2.1.2.2.1.8.436207616 1.3.6.1.2.1.31.1.1.1 .1.436207616 1.3.6.1.2.1.2.2.1.3.436207616
This will let you know if the switch is actually trying send the trap at all. Replace a.b.c.d with the IP destination of the trap server.
You can also run the commands below to check the default configuration for snmp/traps on the switch. From my switches default configuration I have "snmp trap link-status" on by default. I was able to generate the above traps but just flapping eth1/1.
show run int ex/y all | i i trap show run all | i i snmp|trap
HTH
Regards,
Jason.
03-26-2020 07:22 AM
Hi Jason,
Thanks for the reply. Very helpful commands to check the activity on the switch.
In my case, I did a shut/no shut on a not connected interface since this is a setup in production. I am afraid this cannot generate a trap.
So I my question is, how to simulate a trap remotely. I don't have physical access to the device, where maybe a redundant power supply removal could generate a trap.
Thanks,
Nikola
03-26-2020 05:13 PM
A non-disruptive test could be trapping on a feature change. In this example here I'll use `feature bash` which enabled/disabled the BASH shell. First check to see what state you have the feature in (on/off). There should be no disruption turning this feature on/off but I would always recommended to do it during a window/quiet time.
Leaf-9(config)# snmp-server enable traps feature-control FeatureOpStatusChange Leaf-9(config)#
! Check if feature is currently enabled/disabled (it's on in my case)Leaf-9(config)# show feature | i i bash
bash-shell 1 enabled
Leaf-9(config)# no feature bash
Leaf-9(config)#
Leaf-9# ethanalyzer local interface mgmt display-filter "snmp" limit-cap 0
Capturing on mgmt0
2020-03-27 11:11:13.775465 10.66.50.37 -> 192.0.2.1 SNMP trap iso.3.6.1.4.1.9.9.377 1.3.6.1.4.1.9.9.377.1.1.2.1.8.153.1
04-02-2020 07:31 AM
Hi Jason,
Thanks for your support.
At last I enabled the trap "config" which sends a trap if any changes are made to the running-config or startup-config.
This allowed to make some simple changes like interface description and a trap was generated successfully.
BR,
Nikola
04-03-2020 03:27 AM - edited 04-03-2020 03:28 AM
Perfect! Glad to see everything is working =)
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide