a440e77b8f4da0be1911d53dc64ec62517788d87
[freeradius.git] / raddb / sites-available / decoupled-accounting
1 # -*- text -*-
2 ######################################################################
3 #
4 #       This is a sample configuration for "decoupled" accounting.
5 #       "Decoupled" accounting is where the accounting packets are
6 #       NOT written "live" to the back-end database.  This method
7 #       can only be used if you are not interested in "live"
8 #       accounting.  i.e. Where you can tolerate delays that may be
9 #       a few seconds, before accounting packets get written to
10 #       the DB.
11 #
12 #       Oddly enough, this method can speed up the processing of
13 #       accounting packets, as all database activity is serialized.
14 #
15 #       This file is NOT meant to be used as-is.  It needs to be
16 #       edited to match your local configuration.
17 #
18 #       $Id$
19 #
20 ######################################################################
21
22 #  Define a virtual server to write the accounting packets.
23 #  Any "listen" section that listens on an accounting port should
24 #  set "virtual_server = write-detail.example.com
25 server write_detail.example.com {
26         accounting {
27                 #
28                 #  Write the "detail" files.
29                 #
30                 #  See raddb/modules/detail.example.com for more info.
31                 detail.example.com
32         }
33
34         # That's it!
35 }
36
37 #  Define a virtual server to process the accounting packets.
38 server read-detail.example.com {
39         #  Read accounting packets from the detail file(s) for
40         #  the home server.
41         listen {
42                 type = detail
43                 filename = "${radacctdir}/detail.example.com/detail-*:*"
44                 load_factor = 10
45                 track = yes
46         }
47
48         #  All packets read from the detail file are processed through
49         #  the preacct && accounting sections.
50         #
51         #  The following text is copied verbatim from sites-available/default.
52         #  You should edit it for your own local configuration.
53
54 #
55 #  Pre-accounting.  Decide which accounting type to use.
56 #
57 preacct {
58         preprocess
59
60         #
61         #  Ensure that we have a semi-unique identifier for every
62         #  request, and many NAS boxes are broken.
63         acct_unique
64
65         #
66         #  Look for IPASS-style 'realm/', and if not found, look for
67         #  '@realm', and decide whether or not to proxy, based on
68         #  that.
69         #
70         #  Accounting requests are generally proxied to the same
71         #  home server as authentication requests.
72 #       IPASS
73         suffix
74 #       ntdomain
75
76         #
77         #  Read the 'acct_users' file
78         files
79 }
80
81 #
82 #  Accounting.  Log the accounting data.
83 #
84 accounting {
85         #
86         #  Create a 'detail'ed log of the packets.
87         #  Note that accounting requests which are proxied
88         #  are also logged in the detail file.
89         detail
90 #       daily
91
92         #  Update the wtmp file
93         #
94         #  If you don't use "radlast", you can delete this line.
95         unix
96
97         #
98         #  For Simultaneous-Use tracking.
99         #
100         #  Due to packet losses in the network, the data here
101         #  may be incorrect.  There is little we can do about it.
102         radutmp
103 #       sradutmp
104
105         #  Return an address to the IP Pool when we see a stop record.
106 #       main_pool
107
108         #
109         #  Log traffic to an SQL database.
110         #
111         #  NOTE! You will have to ensure that any accounting packets
112         #  NOT handled by the SQL module (e.g. "stop with zero session length"
113         #  result in the accounting section still returning "ok".
114         #
115         #  Otherwise, the server will think that the accounting packet
116         #  was NOT handled properly, and will keep trying to process it
117         #  through this virtual server!
118         #
119         #  See "Accounting queries" in sql.conf
120 #       sql
121
122         #
123         #  Instead of sending the query to the SQL server,
124         #  write it into a log file.
125         #
126 #       sql_log
127
128         #  Cisco VoIP specific bulk accounting
129 #       pgsql-voip
130
131         #  Filter attributes from the accounting response.
132         attr_filter.accounting_response
133
134         #
135         #  See "Autz-Type Status-Server" for how this works.
136         #
137 #       Acct-Type Status-Server {
138 #
139 #       }
140 }
141 }