This article describes how to identify SNMP traps and OID logs in a Junos device, when SNMP traceoption is enabled on it.
How to identify SNMP traps and OID logs in a Junos device, when SNMP traceoption is enabled during a troubleshooting session.
Here is the SNMP working configuration for (v1/v2) with its SNMP log. In this example, the device interface link is flapping and it going up and down. To obtain the log, activate traceoptions for SNMP, as shown below. After the troubleshooting session is complete, it is recommended to de-activate traceoptions. There is no negative impact for traceoptions on SNMP; it is recommended to de-activate it as to avoid unnecessary logs to be stored in the RE hard disk.
SNMP configuration: root@# show snmp | no-more contact SRX; client-list Juniper { 10.10.10.1/32; } community Public { > Community field need to configure exactly same in SNMP server. authorization read-only; } trap-group JTAC{ version all; destination-port 171; categories { authentication; chassis; link; remote-operations; startup; configuration; services; chassis-cluster; } targets { 10.10.10.1; } } traceoptions { > Enable traceoptions in order to get the messages below. file jtac; flag all; }
SNMP configuration:
root@# show snmp | no-more contact SRX; client-list Juniper { 10.10.10.1/32; } community Public { > Community field need to configure exactly same in SNMP server. authorization read-only; } trap-group JTAC{ version all; destination-port 171; categories { authentication; chassis; link; remote-operations; startup; configuration; services; chassis-cluster; } targets { 10.10.10.1; } } traceoptions { > Enable traceoptions in order to get the messages below. file jtac; flag all; }
root@650-2# run show log jtac | no-more Apr 20 18:33:11 snmpd[0] <<< V1 Trap Apr 20 18:33:11 snmpd[0] <<< Source: 10.10.10.10 > SNMP Client IP ( Junos Device) Apr 20 18:33:11 snmpd[0] <<< Destination: 10.10.10.1 > SNMP Server IP (Example: I-Reasoning MIB Browser) Apr 20 18:33:11 snmpd[0] <<< Version: SNMPv1 > SNMP Trap Version No Apr 20 18:33:11 snmpd[0] <<< Community: Public > SNMP Community Apr 20 18:33:11 snmpd[0] <<< Agent addr: 10.10.10.10 Apr 20 18:33:11 snmpd[0] <<< sysUpTime: (53445068) 148:27:30.68 Apr 20 18:33:11 snmpd[0] <<< Enterprise: jnxProductNameSRX650 Apr 20 18:33:11 snmpd[0] <<< Generic trap: 6, Specific trap: 1 Apr 20 18:33:11 snmpd[0] <<< Trap type: linkup > SNMP Trap Categories (Link ) Apr 20 18:33:11 snmpd[0] <<< OID : ifIndex.587 Apr 20 18:33:11 snmpd[0] <<< type : Number Apr 20 18:33:11 snmpd[0] <<< value: 587 Apr 20 18:33:11 snmpd[0] <<< Apr 20 18:33:11 snmpd[0] <<< OID : ifAdminStatus.587 Apr 20 18:33:11 snmpd[0] <<< type : Number Apr 20 18:33:11 snmpd[0] <<< value: 1 Apr 20 18:33:11 snmpd[0] <<< Apr 20 18:33:11 snmpd[0] <<< OID : ifOperStatus.587 Apr 20 18:33:11 snmpd[0] <<< type : Number Apr 20 18:33:11 snmpd[0] <<< value: 1 Apr 20 18:33:11 snmpd[0] <<< Apr 20 18:33:11 snmpd[0] <<< OID : ifName.587 Apr 20 18:33:11 snmpd[0] <<< type : OctetString Apr 20 18:33:11 snmpd[0] <<< value: "ge-0/0/0.0" Apr 20 18:33:11 snmpd[0] <<< HEX : 67 65 2d 30 2f 30 2f 30 Apr 20 18:33:11 snmpd[0] <<< 2e 30
root@650-2# deactivate snmp traceoptions [edit] root@650-2# show snmp inactive: traceoptions { file jtac; flag all; }