Support Support Downloads Knowledge Base Juniper Support Portal Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[EX] How to generate a SNMP trap for any syslog message



Article ID: KB25705 KB Last Updated: 25 Jun 2020Version: 3.0
This article provides information on how to generate a SNMP trap for any syslog message on EX switches and other Junos platforms.
  • The customer's network management system (NMS) uses traps, rather than system log messages to monitor network activity.

  • A syslog message has to be administratively sent to the network management server.

  • There may be some syslog entries with critical severity, which are not sent to the SNMP trap server.
  • Configuring event policies to raise SNMP traps:

    You can convert any syslog message into a trap by using the event-options statement. The following example illustrates how to configure a jnxSyslogTrap,  whenever an rpd_ldp_nbrdown syslog error message occurs:
    user@host> show event-options
        policy snmptrap {
            events rpd_ldp_nbrdown;
            then {
  • Spoofing enterprise specific SNMP traps:

    You can use the request snmp spoof-trap operational mode command to mimic SNMP trap behavior. The contents of the traps (the values and instances of the objects carried in the trap) can be specified on the command line or automatically spoofed. This feature is useful to trigger SNMP traps from routers and ensure that they are processed correctly within your existing network management infrastructure; but you might find it difficult to simulate the error conditions that trigger many of the traps on the switch. This is also useful for testing and debugging SNMP behavior on the switch or NMS.

    The request snmp spoof-trap trap <name> command is for simulating a trap to the NMS, which normally receives the device’s traps. You can also add required values by using the variable-bindings parameter. For more information, refer to the following link:

    On the above link, specifically refer to the SNMP Traps and Informs FAQs section for the following example:

    "A Junos operations (op) script is triggered when a UI_COMMIT_NOT_CONFIRMED event is received. The Junos OP script matches the complete message of the event and generates an SNMP trap".
Modification History:

2020-06-25: Article reviewed for accuracy; no changes required, article valid

Related Links

Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search