Flat-file accounting is typically used to collect and archive
various accounting statistics on logical interfaces for Extensible
Subscriber Services Manager (ESSM) business subscribers. Other applications
include accounting for wholesaler and retailer subscriber activity
in a Layer 2 wholesale environment. Starting in Junos OS Release 16.1R4, you can create
a flat-file profile to use as a template to define attributes for
accounting flat files. The profile specifies
the following:
The statistics fields that are collected.
The filename where the statistics are logged.
The format of the file, the interval at which the statistics
are collected.
The name of the XML schema file that specifies the contents
of the accounting file.
You can configure multiple accounting profiles with different
combinations of fields for specific accounting requirements, and then
assign the profiles as needed to provisioned interfaces to satisfy
the accounting requirements for each interface depending on how it
is used.
A given flat-file profile can be assigned to both use cases;
for example, by specifying all-fields
for a global or group
level. In this case, the fields you configure appear in the accounting
record only if they make sense in the context.
Best Practice: We recommend you use separate flat-file profiles
for ESSM business subscriber logical interfaces and Layer 2 wholesale
core-facing physical interfaces.
To configure flat-file accounting for ESSM business services:
- Create a flat-file profile.
[edit accounting-options]
user@host# edit flat-file-profile profile-name
- (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
- Specify the filename for the accounting file.
[edit accounting-options flat-file-profile profile-name]
user@host# set file accounting-filename
- 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
Best Practice: We recommend that you include the following general
parameter fields in flat-file profiles for ESSM subscribers:
General parameter fields: accounting-type
, descr
, line-id
, logical-interface
, nas-port-id
, timestamp
, and vlan-id
- Specify the accounting statistics that are collected and
recorded in the accounting file.
[edit accounting-options flat-file-profile profile-name fields]
user@host# set egress-stats option
user@host# set ingress-stats option;
user@host# set overall-packet option;
Best Practice: We recommend that you include the following statistics
fields in flat-file profiles for core-facing physical interfaces:
Egress statistics fields: all-fields
Ingress statistics fields: all-fields
Overall packet fields: all-fields
- (Optional) Specify the format of the accounting file.
[edit accounting-options flat-file-profile profile-name]
user@host# set format (csv | 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.
- Configure the maximum size of the accounting file.
[edit accounting-options file filename]
user@host# set size bytes
- 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 the
file.
[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 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 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. Specify whether only the current file form the primary Routing
Engine is saved or both that file and the file from the backup Routing
Engine.
[edit accounting-options file filename]
user@host# set backup-on-failure (master-and-slave | master-only)
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: Files are retained for 1 day if you do not configure this
option.
- Assign the profile to an ESSM subscriber.
[edit system services extensible-subscriber-services]
user@host# set flat-file-profile flat-file-profile-name
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.
16.1R4
Starting in Junos OS Release 16.1R4, you can create
a flat-file profile to use as a template to define attributes for
accounting flat files.