To trace SNMP traffic, you can specify options by including the traceoptions statement at the [edit snmp] hierarchy level:
[edit snmp]
traceoptions {
file <files number> <size size>;
flag flag <disable>;
}
The output of the tracing operations is placed into two files:
/var/log/snmpd—Errors and communications between the server and subagents
/var/log/mib2d—All interface statistics
You can specify the following SNMP-specific flags in the SNMP traceoptions statement:
all—Trace all SNMP events.
interface-stats—Trace physical and logical interface statistics.
pdu—Trace SNMP request and response packets.
protocol-timeouts—Trace SNMP response timeouts.
routing-socket—Trace routing socket calls.
subagent—Trace subagent restarts.
timer—Trace internal timer events.
varbind-error—Trace variable binding errors.
Trace information about SNMP packets:
[edit]
snmp {
traceoptions {
file size 10k files 5;
flag pdu;
flag protocol-timeouts;
flag varbind-error;
}
}