Starting in Junos
OS Release 17.1R1, you can configure flat-file accounting to collect
service statistics for subscribers and report those statistics to
a local file. This configuration collects
the running total service statistics per interface family. Because
the statistics are maintained in the Routing Engine in a statistics
database, they are not affected by a line-card restart, a graceful
Routing Engine switchover, or a unified in-service software upgrade
(ISSU). The statistics counters are reset when the router reboots.
Note: Starting in Junos OS Release 18.4R1, service accounting
in local flat files is no longer supported. If included in a configuration,
it is ignored.
To configure local flat-file accounting for services:
- Configure the subscriber access profile to report service
accounting records in a local flat file.
[edit access profile profile-name]
user@host# set service accounting-order local
Note: When you configure local
, the CLI checks at
commit that the flat-file profile is configured under [edit access
profile profile-name local]
.
Alternatively, you can set the service accounting order to activation-protocol
instead of local
:
user@host# set service accounting-order activation-protocol
Use this option only when you plan to activate the service by
means of the CLI configuration or a command. In this case, the CLI
does not check for the flat-file profile to be configured. If the
profile is not configured, no statistics are collected.
Note: When you configure the local
option, both volume
and time statistics are collected for the service accounting sessions.
In this case, you must not configure the volume-time
option
at the [edit access profile profile-name service accounting statistics]
hierarchy level; otherwise,
an error is generated when you commit the configuration.
- Specify the name of the flat-file profile that is used
to collect the service statistics.
[edit access profile profile-name]
user@host# set local flat-file-profile flat-file-profile-name
- Create the flat-file profile to collect the subscriber
service accounting statistics and other parameters.
- Specify the filename for the accounting file.
[edit accounting-options flat-file-profile profile-name]
user@host# set file accounting-filename
- Specify that service accounting statistics are collected.
[edit accounting-options flat-file-profile profile-name fields]
user@host# set service-accounting
- (Optional) Specify the general, nonstatistical parameters
for the accounting file that are displayed as part of the accounting
record header.
[edit accounting-options flat-file-profile profile-name fields]
user@host# set general-param option
- (Optional) Configure the name of the XML schema for the
accounting flat file.
[edit accounting-options flat-file-profile profile-name]
user@host# set schema-version schema-name
- (Optional) Specify the format of the accounting file.
[edit accounting-options flat-file-profile profile-name]
user@host# set format (csv | ipdr)
Note: When you do not configure this option, the format is ipdr
.
- (Optional) Specify the interval at which the Packet Forwarding
Engine associated with the interface is polled for the statistics
specified in the profile.
[edit accounting-options flat-file-profile profile-name]
user@host# set interval minutes
Note: When you do not configure this option, the polling interval
is 15 minutes.
Note: The interval value configured in the flat-file profile
can be overridden by other interval values:
The service accounting update interval configured at the edit access profile profile-name service accounting
update-interval]
hierarchy level.
An update interval value configured in the RADIUS attribute,
Service-Interim-Acct-Interval (VSA 26–140). This value also
overrides the service accounting update interval.
- Configure the maximum size of the accounting file.
[edit accounting-options file filename]
user@host# set size bytes
- (Optional) Configure the maximum number of files (3 through
1000) to save.
[edit accounting-options file filename]
user@host# set files number
Note: When you do not configure this option, a maximum of 10
files are saved.
- (Optional) Configure one or more archive sites for the
files.
[edit accounting-options file filename]
user@host# set archive-sites site-name
The site-name
is any valid FTP
or Secure FTP URL. When the file is archived, the router attempts
to transfer the file to the archive site. If you have specified more
than one site, it tries the first site in the list. If that fails,
it tries each site in turn until a transfer succeeds The log file
is stored at the archive site with a filename of the format router-name_log-filename_timestamp
. The last site
in a list is often a local directory, in case no remote site is reachable.
- (Optional) Configure the start time for transferring files.
[edit accounting-options file filename]
user@host# set start-time YYYY-MM-DD.hh:mm
- (Optional) Configure how frequently the file is transferred.
[edit accounting-options file filename]
user@host# set transfer-interval minutes
Note: When you do not configure this option, the file is transferred
every 30 minutes.
- (Optional) Configure the router to save a backup copy
of the accounting file to the /var/log/pfedBackup directory if the normal transfer of the files to the archive sites
fails.
[edit accounting-options file filename]
user@host# set backup-on-failure
Note: When you do not configure this option, the file is saved
on failure into the local directory specified as the last site in
the list of archive sites.
- (Optional) Configure the accounting file to be compressed
during transfer to an archive site.
[edit accounting-options file filename]
user@host# set compress
- (Optional) Configure the router’s new backup Routing
Engine to send its accounting file to the /var/log/pfedBackup directory on the new primary Routing Engine when a change in primary
role occurs.
[edit accounting-options file filename]
user@host# set push-backup-to-master
- (Optional) Configure the number of days after which accounting
files are deleted from the local backup directory.
[edit accounting-options]
user@host# set cleanup-interval days
Note: When you do not configure this option, files are retained
for only 1 day.
Change History Table
Feature support is determined by the platform and release you are using. Use Feature Explorer to determine if a feature is supported on your platform.
17.1R1
Starting in Junos
OS Release 17.1R1, you can configure flat-file accounting to collect
service statistics for subscribers and report those statistics to
a local file.