Enabling SNMP notifications for new-root election and topology change events

This feature enables the device to generate logs and report new-root election events or spanning tree topology changes to SNMP. For the event notifications to be sent correctly, you must also configure SNMP on the device. For more information about SNMP configuration, see the network management and monitoring configuration guide for the device.

When you use the snmp-agent trap enable stp [ new-root | tc ] command, follow these guidelines:

To enable SNMP notifications for new-root election and topology change events:

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Enable SNMP notifications for new-root election events.

In STP, MSTP, or RSTP mode, execute either of the following commands:

  • snmp-agent trap enable stp new-root

  • snmp-agent trap enable stp

The default settings are as follows:

  • SNMP notifications are disabled for new-root election events.

  • In MSTP mode, SNMP notifications are enabled in MSTI 0 and disabled in other MSTIs for spanning tree topology changes.

  • In PVST mode, SNMP notifications are disabled for spanning tree topology changes in all VLANs.

3. Enable SNMP notifications for spanning tree topology changes.

In PVST mode, execute either of the following commands:

  • snmp-agent trap enable stp tc

  • snmp-agent trap enable stp

4. Enable the device to generate a log when it detects or receives a TCN BPDU in PVST mode.

stp log enable tc

By default, the device does not generate a log when it detects or receives a TCN BPDU in PVST mode.