Description

This article provides information on how to generate a SNMP trap for any syslog message on MX devices while removing or adding SFP.

Symptoms

  • To Raise trap when SFP is unplugged, when events are not seen in logs by default.
  • To Raise trap when SFP is plugged, when events are not seen in logs by default.

Solution

This can be achieved by having two separate event options for unplugged and plugged events.

The CLIs required are mentioned below for these event options.

When SFP is Unplugged:

set event-options policy snmp-trap-xfp-unplugged events PIC
set event-options policy snmp-trap-xfp-unplugged then raise-trap
set event-options policy snmp-trap-xfp-unplugged attributes-match PIC.message matches "unplugged"


When SFP is Plugged:

set event-options policy snmp-trap-xfp-plugged events PIC
set event-options policy snmp-trap-xfp-plugged then raise-trap
set event-options policy snmp-trap-xfp-plugged attributes-match PIC.message matches "plugged"

Modification History

2022-08-26: Initial publication.

2026-06-25: policy name is corrected