import from branch_1_1:
[freeradius.git] / man / man5 / rlm_counter.5
1 .TH rlm_counter 5 "13 March 2004" "" "FreeRADIUS Module"
2 .SH NAME
3 rlm_counter \- FreeRADIUS Module
4 .SH DESCRIPTION
5 The \fIrlm_counter\fP module provides a general framework to
6 allow access based on accumulated usage of a resource, such as
7 total time online in a given period, total data transferred in
8 a given period, etc.  This is very useful in a 'Prepaid Service'
9 situation, where a user has paid for a finite amount of usage
10 and should not be allowed to use more than that service.  Collection,
11 monitoring, and replenishment of prepaid services are beyond the
12 scope of this module.
13 .PP
14 The main configuration items to be aware of are:
15 .IP filename
16 The filename where the usage data is stored.
17 .IP key
18 An attribute which will be present in the Access-Request to be used as
19 the 'index' value for the counter. A counter entry is tracked for
20 each unique key.  The most likely key you will want to use is User-Name.
21 .IP count-attribute
22 An attribute which will be used to increment the counter value.  If this
23 attribute is Acct-Session-Time or an integer value the counter data is
24 incremented by the Attribute value.  For all other attribute types the 
25 counter is incremented by one.
26 .IP reset
27 How frequently the counter data should be set back to 0.  Valid values for
28 this variable are:
29 .BR hourly,
30 .BR daily,
31 .BR weekly,
32 .BR monthly,
33 .BR or never
34 Alternatively, it can be user defined, in the form: num[hdwm].  num is
35 a numeric value, followed by one or none of the following letters.  h: hours,
36 d: days, w: weeks, m: months.
37 .IP check-name
38 This defines an attribute name which will be registered by the counter module 
39 and can be used to set the maximum allowed value for the counter after which 
40 the user is rejected.  If Daily-Session-Time is set, you can use the following
41 syntax in the Users file to set a cap of 3600 seconds ( 8 hours ):
42 .PP
43 .DS
44 DEFAULT Max-Daily-Session := 3600
45 .DE
46 .PP
47 .IP reply-name
48 This is the name of the attribute which will contain the remaining value for
49 the counter in the reply packet when the user is successfully authorized. The
50 default attribute name is "Session-Timeout".
51 .IP allowed-servicetype
52 This can be used to only apply the limitations to specific service types of
53 sessions.  For example, setting this to Framed-User will only apply the counter
54 module to Framed sessions, excluding other types such as Telnet or Rlogin.
55 .IP cache-size
56 The maximum size of the cache to be used by the module.  The default is 1000.
57 .SH NOTES
58 This module registers an attribute, so it should be added to the
59 instantiate section, to be called on server startup.  When used
60 in the authorize section, it must come after any modules which
61 set the 'check-name' attribute.
62 .PP
63 .SH SECTIONS
64 .BR instantiate,
65 .BR authorize,
66 .BR accounting
67 .PP
68 .SH FILES
69 .I /etc/raddb/radiusd.conf
70 .PP
71 .SH "SEE ALSO"
72 .BR radiusd (8),
73 .BR radiusd.conf (5)
74 .BR rlm_sqlcounter (5)
75 .SH AUTHOR
76 Chris Parker, cparker@segv.org
77