Configuring SNMP Trap
Configure SNMP Trap
Traps are used when the Device needs to alert the Network Management software of an event without being polled. Traps ensure that the NMS gets information if a certain event occurs on the device that needs to be recorded without being polled by the NMS first. Managed network devices will have Trap MIBs with predefined conditions built into them. It’s crucial that the Network management system has these MIBs compiled into them to receive any traps sent by the given device/s. The primary focus of this feature is to support SNMP Trap notifications and in particular, linkUp, linkDown and config change trap notifications.
With these MIBs, you can trigger sending an SNMP trap to a configured SNMP-server host based on certain events. Also, GET/GETNext/WALK operations can be supported on these mibs. The linkUp and linkDown traps are sent to the configured host in the event that an interface Admin or Oper status changes from up to down or vice-versa. The configChange trap monitors NPB (MAP, rule, port-npb config) and port (Speed, MTU, FEC, Autoneg) configuration changes. A configChangeTrap PDU is sent to the host when any value in these tables are modified, added or removed.
Reference
Command
[no] snmp-server trap modify <version><ip4addr|ip6addr> [port <value>] [community
<value>]
Description
SNMP trap configuration
Parameters
Version, IPv4 or v6 Address , port, community values
Mode
CONFIG
Example
pbnoscli# configure terminal
pbnoscli(config)# snmp-server
community Community string authentication
contact Configure SNMP contact
location Configure SNMP location
trap Trap configuration
user SNMP user
pbnoscli(config)# snmp-server trap
cpu-util CPU utilization
disk-util Disk utilization
fan-util FAN utilization
mem-util Memory utilization
modify Modify
psu-util PSU utilization
pbnoscli(config)# snmp-server trap modify
<version> Version value
pbnoscli(config)# snmp-server trap modify 2
<ipaddr> A.B.C.D
<ip6addr> A:B::C:D
server-id Server ID
pbnoscli(config)# snmp-server trap modify 2tr server-id 1
<ipaddr> A.B.C.D
<ip6addr> A:B::C:D
pbnoscli(config)# snmp-server trap modify 2 server-id 1 10.2.2.11 port 29 community public
pbnoscli(config)#
You can verify the configuration by using the command(s) below:
pbnoscli# show snmp-trap
=====================================================================================
Host Version Dest IP Dest Port Community Vrf
=====================================================================================
1 2 10.2.2.11 29 public None
pbnoscli#
Disable PSU/FAN traps:
Below commands can be used to disable FAN/PSU traps temporarily,
Reference
Command
snmp-server trap (psu-util/fan-util) disable
Description
disable PSU/FAN traps temperoraly
Parameters
FAN/PSU
Mode
EXEC
pbnoscli# configure terminal
pbnoscli(config)# snmp
snmp-server SNMP server configuration
pbnoscli(config)# snmp-server
community Community string authentication
trap Trap configuration
pbnoscli(config)# snmp-server trap
cpu-util CPU utilization
disk-util Disk utilization
fan-util FAN utilization
mem-util Memory utilization
modify Modify
psu-util PSU utilization
pbnoscli(config)# snmp-server trap psu-util
disable Disable the PSU traps
pbnoscli(config)# snmp-server trap psu-util
disable Disable the PSU traps. Notify only on state change
pbnoscli(config)# snmp-server trap psu-util disable
pbnoscli(config)# snmp-server trap fan-util disable
pbnoscli(config)# end
pbnoscli#
SNMP Trap Logs:
// As received on the SNMP server
//Disk Traps
10.4.5.244.47699 > npbsrv01.snmp: [udp sum ok] { SNMPv2c C="Aviz" { V2Trap(55) R=755944523 system.sysUpTime.0=5574 S:1.1.4.1.0=88.2.0.3="Current Disk usage 78% falls below threshold 79%" } }
10.4.5.244.47549 > npbsrv01.snmp: [udp sum ok] { SNMPv2c C="Aviz" { V2Trap(55) R=755944523 system.sysUpTime.0=5574 S:1.1.4.1.0=88.2.0.2="Current Disk usage 88% raised above threshold 80%" } }
10.4.5.244.47239 > npbsrv01.snmp: [udp sum ok] { SNMPv2c C="Aviz" { V2Trap(55) R=755944523 system.sysUpTime.0=5574 S:1.1.4.1.0=88.2.0.4="Disk /dev/sda3 failed" } }
//CPU Traps
10.4.5.244.49899 > npbsrv01.snmp: [udp sum ok] { SNMPv2c C="Aviz" { V2Trap(55) R=755944523 system.sysUpTime.0=5574 S:1.1.4.1.0=88.2.0.3="Current CPU usage 70% falling below threshold 80%" } }
10.4.5.244.35699 > npbsrv01.snmp: [udp sum ok] { SNMPv2c C="Aviz" { V2Trap(55) R=755944523 system.sysUpTime.0=5574 S:1.1.4.1.0=88.2.0.2="Current CPU usage 88% raised above threshold 80%" } }
//Memory Traps
10.4.5.244.47689 > npbsrv01.snmp: [udp sum ok] { SNMPv2c C="Aviz" { V2Trap(55) R=755944523 system.sysUpTime.0=5574 S:1.1.4.1.0=88.2.0.3="Current mem usage 71% falling below threshold 80%" } }
10.4.5.244.47656 > npbsrv01.snmp: [udp sum ok] { SNMPv2c C="Aviz" { V2Trap(55) R=755944523 system.sysUpTime.0=5574 S:1.1.4.1.0=88.2.0.2="Current mem usage 88% raised above threshold 80%" } }
//PSU Traps
10.4.4.52.32850 > npbsrv01.snmp: V2Trap(101) system.sysUpTime.0=42198 S:1.1.4.1.0=E:58564.2.1.1.1 E:58564.2.1.1.1="PSU 2 present, status OK"
//FAN Traps
10.4.4.52.32850 > npbsrv01.snmp: V2Trap(100) system.sysUpTime.0=42198 S:1.1.4.1.0=E:58564.2.1.1.2 E:58564.2.1.1.2="fan1 present, status OK"
10.4.4.52.32850 > npbsrv01.snmp: V2Trap(100) system.sysUpTime.0=42198 S:1.1.4.1.0=E:58564.2.1.1.2 E:58564.2.1.1.2="fan2 present, status OK"
10.4.4.52.32850 > npbsrv01.snmp: V2Trap(100) system.sysUpTime.0=42198 S:1.1.4.1.0=E:58564.2.1.1.2 E:58564.2.1.1.2="fan3 present, status OK"
10.4.4.52.32850 > npbsrv01.snmp: V2Trap(100) system.sysUpTime.0=42198 S:1.1.4.1.0=E:58564.2.1.1.2 E:58564.2.1.1.2="fan4 present, status OK"
10.4.4.52.32850 > npbsrv01.snmp: V2Trap(100) system.sysUpTime.0=42198 S:1.1.4.1.0=E:58564.2.1.1.2 E:58564.2.1.1.2="fan5 present, status OK"
10.4.4.52.32850 > npbsrv01.snmp: V2Trap(100) system.sysUpTime.0=42198 S:1.1.4.1.0=E:58564.2.1.1.2 E:58564.2.1.1.2="fan6 present, status OK"
10.4.4.52.32850 > npbsrv01.snmp: V2Trap(100) system.sysUpTime.0=42198 S:1.1.4.1.0=E:58564.2.1.1.2 E:58564.2.1.1.2="fan7 present, status OK"
10.4.4.52.32850 > npbsrv01.snmp: V2Trap(100) system.sysUpTime.0=42198 S:1.1.4.1.0=E:58564.2.1.1.2 E:58564.2.1.1.2="fan8 present, status OK"
10.4.4.52.32850 > npbsrv01.snmp: V2Trap(105) system.sysUpTime.0=42198 S:1.1.4.1.0=E:58564.2.1.1.2 E:58564.2.1.1.2="psu2_fan1 present, status OK"
pbnoscli# show running-config
configure terminal
!
interface mgmt
ip address 10.4.4.52/24 gateway 10.4.4.1
!
snmp-server trap modify 2 server-id 1 10.2.2.11 port 29 community public
snmp-server community public
snmp-server trap fan-util disable
snmp-server trap psu-util disable
!
pbnoscli#
Last updated
Was this helpful?