Table Of Contents
Cisco Access Registrar Accounting
Default Accounting Log File Rollover
Cisco Access Registrar Accounting
This chapter describes Cisco Access Registrar accounting as defined in Internet RFC 2866
Access Registrar accounting is the process of collecting and storing the information contained in Accounting Start and Accounting Stop messages.
When a NAS that uses accounting begins a session, it sends an Accounting Start packet describing the type of service and the user being connected to the Cisco AR server. When the session ends, the NAS sends the Cisco AR server an Accounting Stop packet describing the type of service that was delivered. The Accounting Stop packet might also contain statistics such as elapsed time, input and output octets, or input and output packets.
Setting Up Accounting
To configure Cisco Access Registrar to perform accounting, you must do the following:
•Create a service
•Set the service's type to file
•Set the DefaultAccountingService field in /Radius to the name of the service you created
After you save and reload the Cisco AR server configuration, the Cisco AR server writes accounting messages to the accounting.log file in the /opt/AICar1/logs directory. The Cisco AR server stores information in the accounting.log file until a rollover event occurs. A rollover event is caused by the accounting.log file exceeding a pre-set size, a period of time transpiring, or reaching a scheduled date.
When the rollover event occurs, the data in accounting.log is stored in a file named by the prefix accounting, a date stamp (yyyymmdd), and the number of rollovers for that day. For example, accounting-20010619-14 would be the 14th rollover on June 19, 2001.
The properties for a service called CiscoAccounting are listed below:
[ //localhost/Radius/Services/CiscoAccounting ]
Name = CiscoAccounting
Description =
Type = file
IncomingScript~ =
OutgoingScript~ =
OutagePolicy~ = RejectAll
OutageScript~ =
FilenamePrefix = accounting
MaxFileSize = "10 Megabytes"
MaxFileAge = "1 Day"
RolloverSchedule =You can configure an accounting service using any combination of MaxFileSize, MaxFileAge, and RolloverSchedule. For example, you might configure RolloverSchedule and MaxFileAge at the same time. This would be useful if you wanted to have an age-based rollover, but also synchronize to an absolute clock at specified times. The following would set a rollover every twelve hours at 11:59 and 23:59.
set MaxFileAge "12 H"
set RolloverSchedule "59 11,23 * * *"
You might also consider scheduling MaxFileAge to be six minutes and set RolloverSchedule to the top of the hour. The following would create ten six-minute long files starting anew every hour.
set MaxFileAge "6 Minutes"
set RolloverSchedule "0 * * * *"
Note Although you specify an exact time with the RolloverSchedule property, the Cisco AR server only checks the rollover schedule when an accounting event occurs. If your Cisco AR server receives a steady flow of packets (at least one per minute), the times you specify are accurate. However, if the Cisco AR server does not receive any packets for a period of time, no rollovers will occur until the next packet is received. The same is true for MaxFileAge and MaxFileSize.
RolloverSchedule
You set RolloverSchedule using the following crontab-style time format:
minute hour "day of month" "month of year" "day of week"
Where:
Minute is a value from 0-59
Hour is a value from 0-23
Day (of the month) is a value from 1-31
Month is a value from 1-12
Day (of the week) is a value from 0-6, where 0 is Sunday
MaxFileAge
Use MaxFileAge to indicate the maximum age of the log file in minutes, hours, days, or weeks. MaxFileAge measures the age of the accounting.log file from the time the previous file rollover occurred.
You can specify the following (case insensitive) periods of time:
•M, Minute, or Minutes preceded by a number from 0 to 59
•H, Hour, or Hours preceded by a number from 0 to 23
•D, Day, or Days preceded by a number from 1 to 31
•W, Week, or Weeks preceded by a number from 1 to 52
The following are examples of valid commands to set MaxFileAge:
set MaxFileAge "6 Minutes"
sets a MaxFileAge of 6 minutes
set maxf ileage "2 d"
sets a MaxFileAge of 2 days
set maxfileage "1 H"
sets a MaxFileAge of 1 hour
MaxFileSize
Use MaxFileSize to indicate the maximum age of the accounting.log file in minutes, hours, days, or weeks. MaxFileAge measures the age of the accounting.log file from the time the previous file rollover occurred.
You can specify the following (case insensitive) file sizes:
•K, Kilobytes, Kilobytes
•M, Megabyte, Megabytes
•G, Gigabyte, Gigabytes
The following are examples of valid commands to set MaxFileSize:
set MaxFileSize "500 kilobytes"
sets a MaxFileSize of 500 kilobytes
set maxfilesize "1 G"
sets a MaxFileSize of one gigabyte
set maxfilesize "200 megabyte"
sets a MaxFileSize of 200 megabytes
Default Accounting Log File Rollover
When you set up an accounting service and set its type to file, Cisco AR automatically sets the following properties for accounting log file rollover:
•FilenamePrefix is set to "accounting"
•MaxFileSize is set to "10 Megabytes"
•MaxFileAge is set to "1 Day"
Accounting log file rollover occurs when either MaxFileSize or MaxFileAge occurs, regardless of the other parameter. In other words, if the accounting log file reaches MaxFileSize in one hour, the accounting log file will roll over.
Note Every service of type file in your configuration causes a file with the configured name to be created upon server startup, even if the service is not being invoked by any request packets.
Accounting log file rollover also occurs at the date and time specified in the RolloverSchedule property. This type of rollover occurs regardless of the MaxFileSize or MaxFileAge setting.