After information is output to an SNMP agent, the NMS can receive the information from the Device through an SNMP agent.
On the network shown in Figure 1, a Device is connected to the NMS. To monitor the Device operation in real time or collect important information about the Device operation, you can output traps to an SNMP agent. The SNMP agent forwards the information to an NMS.
In this example, traps are output to a remote terminal.
Interfaces 1 in this example are GE 0/1/0.
The configuration roadmap is as follows:
Enable the information management function.
Configure the channel through which traps are output to an SNMP agent and the module of which traps are to be output.
Output traps to the SNMP agent.
Output traps to an NMS through an SNMP agent.
To complete the configuration, you need the following data:
Information channel number
Module and severity of the traps to be output
<HUAWEI> system-view [~HUAWEI] sysname Device [*HUAWEI] commit [~Device] info-center enable
# Output traps whose severity is informational or higher to channel 7.
[*Device] info-center source im channel channel7 trap level informational
[*Device] info-center snmp channel channel7
# Enable the SNMP agent function, with the SNMP version of SNMPv2c.
[*Device] snmp-agent sys-info version v2c
# Enable the SNMP agent to send traps.
[*Device] snmp-agent trap enable [*Device] snmp-agent target-host trap address udp-domain 10.1.1.1 params securityname public
# Display the channel used by the SNMP agent to output traps.
[~Device] display info-center Information Center:enabled Log host: Console: channel number : 0, channel name : console Monitor: channel number : 1, channel name : monitor SNMP Agent: channel number : 7, channel name : channel7 Log buffer: enabled,max buffer size 10240, current buffer size 512, current messages 10, channel number : 4, channel name : logbuffer dropped messages 0, overwritten messages 0 Trap buffer: enabled,max buffer size 1024, current buffer size 256, current messages 3, channel number:3, channel name:trapbuffer dropped messages 0, overwritten messages 0 logfile: channel number : 9, channel name : channel9, language : English Information timestamp setting: log - date, trap - date, debug - date millisecond
# Display the information output to the SNMP agent through the channel.
[~Device] display channel 7 channel number:7, channel name:channel7 ModuID Name Enable LogLevel Enable TrapLevel Enable DebugLevel ffffffff default Y debugging Y debugging N debugging 00000957 IM Y debugging Y informational N debugging
# Display trap information output by the SNMP agent to the NMS.
[*Device] display snmp-agent target-host Target-host NO. 1 ----------------------------------------------------------- Host-name : targetHost_2 IP-address : 10.1.1.1 Source interface : - VPN instance : - Security name : %^%#-(}fC-|38%RgqpW$+c^UU"AH()$q#K26fL2X5XK7%^%# Port : 162 Type : trap Version : v2c Level : No authentication and privacy NMS type : HW NMS With ext-vb : No Notification filter profile name : - -----------------------------------------------------------
# sysname Device # info-center source im channel 7 trap level informational info-center snmp channel 7 # interface GigabitEthernet0/1/0 undo shutdown ip address 10.1.1.2 255.255.255.0 # snmp-agent # snmp-agent sys-info version v2c v3 snmp-agent target-host trap address udp-domain 10.1.1.1 params securityname cipher %^%#-(}fC-|38%RgqpW$+c^UU"AH()$q#K26fL2X5XK7%^%# # snmp-agent trap enable # return