< Home

(Optional) Configuring the Trap Function

You can configure the trap function for the device to send traps of specific features to the NMS, which will help you to locate important problems. In addition, you can set trap sending parameters to improve trap sending reliability.

Procedure

  1. Access the system view.

    system-view

  2. Enable the trap functions of all modules.

    snmp-agent trap enable

  3. Enable the trap function of a feature module.

    snmp-agent trap enable feature-name feature-name trap-name trap-name

    This means that a trap of a specific feature can be sent to the NMS.

  4. Specify or update the traps that can be sent to the NMS.

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

    At present, the snmp-agent notify-filter-profile command supports either the variable OID of a character string or an object name. If the entered parameter is a character string, the asterisk (*) can be used as the mask. The asterisk (*) can be placed only in the middle, not at the beginning or end of the string.

  5. Specify the source interface for traps.

    snmp-agent trap source interface-type interface-number

    After the source interface is specified, its IP address becomes the source IP address of trap messages. Configuring the IP address of the local loopback interface as the source interface is recommended, which can ensure device security.

    The source interface specified on the FW for traps must be consistent with that specified on the NMS; otherwise, the NMS will not accept the traps sent from the FW.

  6. Set the source port that sends traps.

    snmp-agent trap source-port port-number

    The source port is fixed, the packets can be filtered by FW to improve the security of the network.

  7. Set the length of the queue storing traps to be sent to the destination host.

    snmp-agent trap queue-size size

    The queue length depends on the number of generated traps. If the FW frequently generates traps, a longer queue length can be set to prevent traps from being lost.

  8. Set the lifetime of every trap.

    snmp-agent trap life seconds

    The lifetime of every trap depends on the number of generated traps. If the FW frequently generates traps, a longer lifetime can be set for every trap to prevent traps from being lost.

  9. Run:

    snmp-agent trap start-trap resend disable

    The function of resending device cold-start or warm-start traps is disabled.

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

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