< Home

(Optional) Configuring the Trap/Inform Function

Context

You can enable the device to send traps of a specified type to the NMS, which facilitates fault location. You can also specify trap parameters to improve the reliability of trap transmission.

Procedure

  1. Run system-view

    The system view is displayed.

  2. Enable the trap function.

    Enable the trap function for a module:

    • To enable the trap function of all modules, run the snmp-agent trap enable command.

    • To enable the trap function of a specified module, run the snmp-agent trap enable feature-name feature-name [ trap-name trap-name ] command.

    • To restore the trap functions of all modules to the default status, run the undo snmp-agent trap enable or undo snmp-agent trap disable command.

    • To delete all trap functions in a batch, run the clear configuration snmp-agent trap enable command.

    Enable the trap function for an interface:

    Run the snmp-agent trap enable feature-name ifnet trap-name { linkdown | linkup } command to enable the interface status trap function globally.

    By default, the trap function is disabled on all interfaces. When the linkdown and linkup parameters are configured for ifnet module, the device sends a trap to the NMS upon an interface status change. If the interface status frequently changes, the interface frequently sends traps to the NMS, subjecting the NMS to a heavy load. To combat this problem, disable the interface status trap function on the interface. The procedure is as follows:

    1. Run the interface interface-type interface-number command to enter the interface view.

    2. Run the undo enable snmp trap updown command to disable the interface status trap function.

    3. Run the quit command to return to the system view.

  3. Run snmp-agent trap type { base-trap | entity-trap }

    The trap format is set.

    By default, the device sends BASETRAP traps.

  4. Run snmp-agent notify-filter-profile { excluded | included } profile-name oid-tree

    A trap filtering rule is created or updated.

    By default, traps are not filtered.

  5. Set trap parameters based on the configuration of basic SNMP functions.

    Set trap parameters:

    1. Run the snmp-agent trap source interface-type interface-number command to specify the source interface that sends traps.

      After the source interface is specified, the IP address of the source interface is used as the source IP address for sending traps. To ensure device security, it is recommended that you set the address of the local loopback interface as the source interface address.

      The source interface in traps sent by the switch must be the same as the source interface specified on the NMS. Otherwise, the NMS cannot receive traps.

    2. Run the snmp-agent trap source-port port-number command to specify the source interface that sends traps.

      If you configure a fixed source interface, firewalls on user networks can filter packets based on this source interface. Therefore, a fixed source interface improves network security.

    3. Run the snmp-agent trap queue-size size command to set the queue length of traps sent to the target host.

      The default queue length of traps sent to the target host is 1000.

      Set the queue length according to the number of generated traps. For example, if the switch frequently sends traps to the NMS, set a longer queue length to prevent traps from being lost.

    4. Run the snmp-agent trap life seconds command to set the lifetime of traps.

      The default lifetime of traps is 300 seconds.

      Set the lifetime of each trap according to the number of generated traps. For example, if the switch frequently sends traps to the NMS, set a longer lifetime to prevent traps from being lost.

    5. Run the snmp-agent trap start-trap resend disable command to disable the function of resending device cold-start or warm-start traps.

      By default, the function of resending device cold-start or warm-start traps is enabled.

    Set inform parameters:

    1. Run the snmp-agent inform { timeout seconds | resend-times times | pending number }* command to set global inform parameters.

      The parameters include the timeout period for waiting for ACK messages, number of times to retransmit informs, and maximum number of informs to be confirmed in the inform buffer.

      When setting the timeout period on a network that is unstable, specify the number of inform retransmissions and maximum number of informs to be acknowledged. By default, this timeout period is 15 seconds. The default number of inform retransmissions and the maximum number of informs waiting to be acknowledged are 3 and 39, respectively.

    2. Run the snmp-agent inform { timeout seconds | resend-times times } * address udp-domain ip-address [ vpn-instance vpn-instance-name ] params securityname { security-name | cipher security-name } command to set the timeout period for waiting for inform ACK messages from a specified NMS and the number of inform retransmissions.

      If the network is unstable, you need to specify the number of inform retransmissions when you set a timeout period for waiting for inform ACK messages. By default, the timeout period for waiting for inform ACK messages is 15 seconds, and the number of inform retransmissions is 3.

    3. Run the snmp-agent notification-log enable command to enable the inform log function.

      If the NMS and managed device cannot communicate because of a link failure, the managed device no longer sends informs but keeps recording inform logs. When the link recovers, the target host synchronizes the recorded inform logs from the managed device.

      After the inform log function is enabled, the device records informs it sends. Traps sent by the device are not recorded.

      By default, the trap log function is disabled.

    4. Run the snmp-agent notification-log { global-ageout ageout | global-limit limit }* command to set the aging time of trap logs and the maximum number of trap logs in the log buffer.

      By default, the aging time of trap logs is 24 hours. When the aging time expires, the trap logs are automatically deleted.

      By default, the log buffer can store a maximum of 500 trap logs. If the number of trap logs to be stored exceeds 500, the NMS deletes trap logs from the earliest one.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >