Go to the first, previous, next, last section, table of contents.


Accounting

By default GNU Radius supports three types of accounting. Any additional accounting methods can be defined using extension mechanisms.

The accounting methods are applied to a request in a following sequence:

  1. UNIX Accounting
  2. Detailed Request Accounting
  3. SQL Accounting
  4. Custom Accounting

In this sequence, only UNIX Accounting is obligatory, all other methods are applied only when enabled.

If any accounting type in this sequence fails, the accounting is deemed to fail and all subsequent methods are not invoked.

UNIX Accounting

This accounting method is always enabled.

Radius keeps files `radutmp' and `radwtmp' in its logging directory and stores the accounting data there. The utilities radwho and radlast can be used to list information about users' sessions.

Detailed Request Accounting

Radius stores the detailed information about accounting packets it receives in files
`radacct/nasname/detail' (see section Naming Conventions), where nasname is replaceed with the short name of the NAS from the `raddb/naslist' file (see section NAS List -- `raddb/naslist').

By default, this accounting type is always enabled, provided that `radacct' directory exists and is writable (see section Naming Conventions). To turn the detailed accounting off, use detail statement in `config' file. For more information about it, See section acct statement.

The accounting detail files consist of a record per each accounting request. A record includes the timestamp and detailed dump of attributes from the packet, e.g.:

    Fri Dec 15 18:00:24 2000
            Acct-Session-Id = "2193976896017"
            User-Name = "e2"
            Acct-Status-Type = Start
            Acct-Authentic = RADIUS
            Service-Type = Framed-User
            Framed-Protocol = PPP
            Framed-IP-Address = 11.10.10.125
            Calling-Station-Id = "+15678023561"
            NAS-IP-Address = 11.10.10.11
            NAS-Port-Id = 8
            Acct-Delay-Time = 0
            Timestamp = 976896024
            Request-Authenticator = Unverified
    
    Fri Dec 15 18:32:09 2000
            Acct-Session-Id = "2193976896017"
            User-Name = "e2"
            Acct-Status-Type = Stop
            Acct-Authentic = RADIUS
            Acct-Output-Octets = 5382
            Acct-Input-Octets = 7761
            Service-Type = Framed-User
            Framed-Protocol = PPP
            Framed-IP-Address = 11.10.10.125
            Acct-Session-Time = 1905
            NAS-IP-Address = 11.10.10.11
            NAS-Port-Id = 8
            Acct-Delay-Time = 0
            Timestamp = 976897929
            Request-Authenticator = Unverified

SQL Accounting

The SQL accounting method is enabled when Radius is configured with --enable-sql option and `sqlserver' file in its configuration directory is properly set up (see section SQL Configuration -- `raddb/sqlserver').

This version of GNU Radius (0.96) supports MySQL and PostgreSQL servers. Support for Oracle servers will be added in the nearest future.

With this accounting method enabled, radiusd will store the information about accounting requests in the configured SQL database. The accounting method is fully configurable: the Radius administrator defines both the types of requests to be accounted and the information to be stored into the database. (see section SQL Configuration -- `raddb/sqlserver').

Defining Custom Accounting Types.

If the built-in accounting methods do not meet your requirements, you can implement your own accounting methods. There are two ways for doing so:

  1. Using a Guile procedure.
  2. Using an external program

To use a Guile procedure for accounting, the name of the procedure must be specified as a value to Scheme-Acct-Procedure attribute in RHS list of a `hints' entry, e.g.:

    DEFAULT NULL Scheme-Acct-Procedure = "my-acct"

For a detailed description of Scheme accounting procedures, See section Accounting with Scheme.

Another way of implemementing your own accounting method is using an external program. This is less effective than the methods described above, but may be necessary sometimes. To invoke the program, use the following statement in the LHS of `hints' entry:

    Acct-Ext-Program = "progname args"

The progname must be the full path to the program, args --- any arguments it needs. The usual substitutions may be used in args to pass any request attributes to the program (see section Macro Substitution).

For a detailed description of Acct-Ext-Program, See section Acct-Ext-Program.


Go to the first, previous, next, last section, table of contents.