Logging Enterprise-Specific Traps

Problem

You want to collect Juniper Networks enterprise-specific traps in the router's system logging files.

Solution

Use the following commands to save all log messages to a file called snmp-critical-traps:

[edit] user@router1# edit system syslog file snmp-critical-traps [edit system syslog file snmp-critical-traps ] user@router1# set daemon critical

 

Discussion

The traps from the Juniper Networks chassis MIB all have a system logging severity level associated with them. You can take advantage of this to collect these traps in a system logfile. The chassis traps record chassis component information that is critical to the operation of the router, such as power supply and fan failures. In this recipe, we collect all critical and alert logging messages generated by all JUNOS processes, including SNMPD and MIB2D, which captures most of the SNMP chassis traps.

Table 4-2 shows all the chassis traps and their corresponding severity level. In the system logging file, these messages are prefixed with the identifier CHASSISD_SNMP_TRAP.

Table 4-2. System logging severity levels for Juniper Networks chassis SNMPv2 traps

Severity level

Chassis SNMPv2 trap

Notice

jnxFruInsertion

 

Insertion of a replaceable chassis component

 

jnxFruPowerOff

 

Powering down of a replaceable chassis component

 

jnxFruPowerOn

 

Powering up of a replaceable chassis component

 

jnxFruRemoval

 

Removal of a replaceable chassis component

Critical

jnxFanFailure

 

Chassis fan or impeller failure

 

jnxFanOK

 

Chassis fan or impeller recovery

 

jnxOverTemperature

 

Overheating of a hardware component

 

jnxPowerSupplyOK

 

Power supply recovery

 

jnxRedundancySwitchOver

 

Chassis component has switched from master to backup, or vice versa

Alert

jnxPowerSupplyFailure

 

Power supply failure

 

jnxTemperatureOK

 

Overheating recovery by a hardware component

The Juniper Networks chassis MIB traps are the only enterprise-specific traps that are associated with a system logging severity level, so they are the only ones that you can specifically log.

See Also

Recipe 5.1

Категории