Table Of Contents
Cisco CNS Access Registrar HLR Proxy Server Accounting
Understanding Cisco Access Registrar Accounting
Setting Up Accounting
Accounting Log File Rollover
Configuring Accounting
RolloverSchedule
MaxFileAge
MaxFileSize
Cisco CNS Access Registrar HLR Proxy Server Accounting
This chapter describes Cisco CNS Access Registrar HLR Proxy Server accounting as defined in Internet RFC 2866.
Understanding Cisco Access Registrar Accounting
Cisco 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 HLR Proxy 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 the Cisco HLR Proxy Server 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 HLR Proxy Server configuration, the Cisco HLR Proxy Server writes accounting messages to the accounting.log file in the /opt/CSCOar/logs directory. The Cisco HLR Proxy 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 on 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 following shows the properties for a service called CiscoAccounting:
[ //localhost/Radius/Services/CiscoAccounting ]
Name = CiscoAccounting
Description =
Type = file
IncomingScript~ =
OutgoingScript~ =
OutagePolicy~ = RejectAll
OutageScript~ =
FilenamePrefix = accounting
MaxFileSize = "10 Megabytes"
MaxFileAge = "1 Day"
RolloverSchedule =
Accounting Log File Rollover
Cisco Access Registrar's accounting functionality has been enhanced to provide flexibility in managing the accounting log. You can now configure the Cisco HLR Proxy Server to rollover the accounting log using any combination of the following Cisco AR accounting service properties:
•
RolloverSchedule— Indicates the exact time including the day of the month or day of the week, hour and minute to roll over the accounting log file
•
MaxFileAge— Indicates the maximum age of the log file in minutes, hours, days, or weeks
•
MaxFileSize— Indicates the maximum size of the accounting log file in KB, MB, or GB
Configuring Accounting
To configure Cisco HLR Proxy Server 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/CSCOar/logs directory.
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 following shows the properties for a service called CiscoAccounting:
[ //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 MaxFileAge 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