snmp-agent trap (system view)

Function

The snmp-agent trap disable command disables the trap function for all features.

The undo snmp-agent trap disable command restores the trap function for all features to the default status.

The snmp-agent trap enable command enables the device to send trap messages.

The undo snmp-agent trap enable command restores the default trap function.

By default, the display snmp-agent trap all command can be used to view the status of the trap function for all features.

Format

snmp-agent trap enable

snmp-agent trap disable

undo snmp-agent trap { enable | disable }

Parameters

Parameter Description Value
disable

disable.

-

enable

enable.

-

Views

System view

Default Level

3: Management level

Task Name and Operations

Task Name Operations
log write

Usage Guidelines

Usage Scenario

The snmp-agent trap enable command must be used together with the snmp-agent target-host inform command or snmp-agent target-host trap command.

To enable a device to send trap messages, run at least the snmp-agent target-host inform command or snmp-agent target-host trap command on the device to specify the destination address of the trap messages.

To enable the trap function for all features, run the snmp-agent trap enable command. To enable the trap function for a specified feature, run the snmp-agent trap enable feature-name command.

  • To disable the trap function for all features, run the snmp-agent trap disable command.
  • To restore the trap function for all features to the default status, run the undo snmp-agent trap disable or undo snmp-agent trap enable command.

    To disable the trap function for a specified feature, run the undo snmp-agent trap enable feature-name command.

Precautions

The snmp-agent trap enable command and the related commands are used in the following scenarios:

  • To enable trap functions of all modules at a time, run the snmp-agent trap enable command.
  • To enable trap functions of a specified module, run the snmp-agent trap enable feature-name command.
  • If you want to disable the trap function of a specified module, run the undo snmp-agent trap enable feature-name command.
  • To enable specified trap functions of a specified module, run the snmp-agent trap enable feature-name trap-name command.
  • To disable the trap function of a specified module, run the undo snmp-agent trap enable feature-name trap-name command.
  • To restore all default trap functions at a time, run the undo snmp-agent trap enable command.

Example

# Disable the trap function for all features.
<HUAWEI> system-view
[~HUAWEI] snmp-agent trap disable
# Enable the device to send trap messages.
<HUAWEI> system-view
[~HUAWEI] snmp-agent trap enable
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >