Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Configuring Flat-File Accounting for Extensible Subscriber Services Management

date_range 06-Dec-23

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:

  1. Create a flat-file profile.
    content_copy zoom_out_map
    [edit accounting-options]
    user@host# edit flat-file-profile profile-name
    
  2. (Optional) Configure the name of the XML schema for the accounting flat file.
    content_copy zoom_out_map
    [edit accounting-options flat-file-profile profile-name]
    user@host# set schema-version schema-name
    
  3. Specify the filename for the accounting file.
    content_copy zoom_out_map
    [edit accounting-options flat-file-profile profile-name]
    user@host# set file accounting-filename
    
  4. Specify the general, nonstatistical parameters for the accounting file that are displayed as part of the accounting record header.
    content_copy zoom_out_map
    [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

  5. Specify the accounting statistics that are collected and recorded in the accounting file.
    content_copy zoom_out_map
    [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

  6. (Optional) Specify the format of the accounting file.
    content_copy zoom_out_map
    [edit accounting-options flat-file-profile profile-name]
    user@host# set format (csv | ipdr)
    
  7. (Optional) Specify the interval at which the Packet Forwarding Engine associated with the interface is polled for the statistics specified in the profile.
    content_copy zoom_out_map
    [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.

  8. Configure the maximum size of the accounting file.
    content_copy zoom_out_map
    [edit accounting-options file filename]
    user@host# set size bytes
    
  9. Configure one or more archive sites for the files.
    content_copy zoom_out_map
    [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.

  10. (Optional) Configure the start time for transferring the file.
    content_copy zoom_out_map
    [edit accounting-options file filename]
    user@host# set start-time YYYY-MM-DD.hh:mm
    
  11. (Optional) Configure how frequently the file is transferred.
    content_copy zoom_out_map
    [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.

  12. (Optional) Configure the maximum number of files (3 through 1000) to save.
    content_copy zoom_out_map
    [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.

  13. (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.
    content_copy zoom_out_map
    [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.

  14. (Optional) Configure the accounting file to be compressed during transfer to an archive site.
    content_copy zoom_out_map
    [edit accounting-options file filename]
    user@host# set compress
    
  15. (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.
    content_copy zoom_out_map
    [edit accounting-options file filename]
    user@host# set push-backup-to-master
    
  16. (Optional) Configure the number of days after which accounting files are deleted from the local backup directory.
    content_copy zoom_out_map
    [edit accounting-options]
    user@host# set cleanup-interval days
    
    Note:

    Files are retained for 1 day if you do not configure this option.

  17. Assign the profile to an ESSM subscriber.
    content_copy zoom_out_map
    [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.

Release
Description
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.
footer-navigation