Are the SNMP counters ifInOctets and ifOutOctets the same as the command reference show interfaces statistics in and out counters?
Yes, these are the same, but only if SNMP is enabled when the router boots up. If you power on a Juniper Networks device and then enable SNMP, the SNMP counters start from 0. SNMP counters do not automatically receive their statistics from the show command output. Similarly, using the clear statistics command does not clear the statistics that the SNMP counters collected, which can cause a discrepancy in the data that is seen by both processes.
The SNMP counters ifInOctets and ifOutOctets include the framing overhead for Point-to-Point Protocol (PPP) and High-Level Data Link Control (HDLC).
For a list of standard SNMP MIBs that are supported on various devices running Junos OS, click Standard SNMP MIBs supported by Junos OS.