Configure Local Accounting as a Fallback Solution
Learn how to configure the Local Accounting on a MX204, MX301, MX304, MX10004, or MX10008 router.
Use on-box accounting as a fallback to collect key statistics when external monitoring systems are unavailable. Although protocols such as gRPC and gNMI provide reliable telemetry, local data collection supports post‑event analysis when management connectivity is lost.
Use the following example templates to capture local statistics:
- Routing Engine KPIs
- Interface statistics (primarily error counters)
Routing Engine Profile
Configure a routing‑engine accounting profile to store periodic statistics locally. First, define a local file, then specify the fields to collect in CSV format.
The following example saves key counters from the master Routing Engine at 1‑minute intervals:
set accounting-options file memcpu-log size 10m set accounting-options file memcpu-log transfer-interval 2880 set accounting-options routing-engine-profile re-profile file memcpu-log set accounting-options routing-engine-profile re-profile interval 1 set accounting-options routing-engine-profile re-profile fields date set accounting-options routing-engine-profile re-profile fields time-of-day set accounting-options routing-engine-profile re-profile fields cpu-load-1 set accounting-options routing-engine-profile re-profile fields cpu-load-5 set accounting-options routing-engine-profile re-profile fields cpu-load-15 set accounting-options routing-engine-profile re-profile fields cpu-usage-5sec set accounting-options routing-engine-profile re-profile fields cpu-usage-1min set accounting-options routing-engine-profile re-profile fields cpu-usage-5min set accounting-options routing-engine-profile re-profile fields memory-usage set accounting-options routing-engine-profile re-profile fields total-cpu-usage
Interface Profile
To enable local statistics collection for each interface, apply the following configuration:
set accounting-options file ifstats-log size 10m set accounting-options file ifstats-log transfer-interval 2880 set accounting-options interface-profile ifstat-profile file ifstats-log set accounting-options interface-profile ifstat-profile interval 1 set accounting-options interface-profile ifstat-profile fields input-bytes set accounting-options interface-profile ifstat-profile fields output-bytes set accounting-options interface-profile ifstat-profile fields input-packets set accounting-options interface-profile ifstat-profile fields output-packets set accounting-options interface-profile ifstat-profile fields input-errors set accounting-options interface-profile ifstat-profile fields output-errors
Enable accounting on each physical interface where you need to collect statistics. Configure this feature only on critical paths to limit resource usage.
Use local interface accounting as a fallback when external data collection is unavailable during an outage.
For each interface, enable local statistics collection as shown below:
set interfaces et-0/0/8 accounting-profile ifstat-profile
Display the statistics by viewing the local file contents. For example, use the file generated by the interface accounting profile:
show log ifstats-log #FILE CREATED 1776704488 2026-04-20-17:01:28 #hostname rtme-mx304-06 #profile-layout ifstat-profile,epoch-timestamp,interface-name,snmp-index,input-bytes,output-bytes,input-packets,output-packets,input-errors,output-errors ifstat-profile,1776704488,et-0/0/8,542,88839,287600,223,2867,0,0 ifstat-profile,1776704548,et-0/0/8,542,90054,290378,226,2895,0,0 ifstat-profile,1776704608,et-0/0/8,542,90864,293152,228,2923,0,0 ifstat-profile,1776704668,et-0/0/8,542,91674,296009,230,2952,0,0
Use a dedicated CLI command to provide filtering capabilities:
show accounting records ifstat-profile since 2026-04-21.01:00:00
Timestamp: 1776758428, Interface Name: et-0/0/8 (SNMP Index 542)
875349 Input Bytes
2865898 Output Bytes
2165 Input Packets
28647 Output Packets
0 Input Errors
0 Output Errors
Timestamp: 1776758488, Interface Name: et-0/0/8 (SNMP Index 542)
876159 Input Bytes
2868755 Output Bytes
2167 Input Packets
28676 Output Packets
0 Input Errors
0 Output Errors