Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

emit_snmp_attributes Function (Python)

 

Syntax

Python Syntax

Release Information

Function introduced in Junos OS Release 16.1R1 on QFX Series switches and MX Series, PTX Series, and T Series routers.

Function introduced in Junos OS Release 17.1R1 on ACX500, ACX1000, ACX1100, ACX2000, ACX2100, ACX2200, and ACX4000 routers, and EX Series switches.

Function introduced in Junos OS Release 17.3R1 on SRX1500, SRX4100, SRX4200, SRX5400, SRX5600, and SRX5800 devices and vSRX instances.

Function introduced in Junos OS Release 18.3R1 on ACX5048 and ACX5096 routers.

Description

Return the attributes for the requested MIB object from a Python SNMP script.

SNMP scripts provide the flexibility to support custom MIBs. SNMP scripts are triggered automatically when the SNMP manager requests information for an unsupported object identifier (OID) that is mapped to an SNMP script. When the script is invoked, the jcs.emit_snmp_attributes() function emits the data for the requested object. The script acts like an SNMP subagent, and the system sends the return value from the script to the network management system (NMS).

Parameters

snmp_oidString containing the OID about which the script is returning information.
snmp_oid_typeString that specifies the type of the data being returned for the requested MIB object. Acceptable values are Counter32, Counter64, Integer32, Unsigned32, and Octet String.
snmp_oid_valueData to return for the requested MIB object.

Usage Examples

The following example Python SNMP script processes unsupported object identifiers (OIDs) that are mapped to the script in the Junos OS configuration. The emit_snmp_attributes() function returns the attributes for the requested OID.