~ubuntu-branches/ubuntu/natty/freeradius/natty-updates

« back to all changes in this revision

Viewing changes to raddb/experimental.conf

  • Committer: Bazaar Package Importer
  • Author(s): Paul Hampson
  • Date: 2006-01-15 13:34:13 UTC
  • mto: (3.1.3 dapper) (4.1.3 sid) (1.1.14 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20060115133413-zo1dslttvdoalqym
Tags: upstream-1.1.0
ImportĀ upstreamĀ versionĀ 1.1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
#
4
4
#  By default, it is NOT included in the build.
5
5
#
6
 
#  $Id: experimental.conf,v 1.25.2.1 2005/02/09 17:52:55 aland Exp $
 
6
#  $Id: experimental.conf,v 1.25.2.1.2.2 2005/12/13 16:32:51 nbk Exp $
7
7
#
8
8
 
9
9
        # Configuration for the Python module.
75
75
                }
76
76
        }
77
77
 
78
 
 
79
 
        #  This module is an SQL enabled version of the counter module.
80
 
        #  
81
 
        #  Rather than maintaining seperate (GDBM) databases of
82
 
        #  accounting info for each counter, this module uses the data
83
 
        #  stored in the raddacct table by the sql modules. This
84
 
        #  module NEVER does any database INSERTs or UPDATEs.  It is
85
 
        #  totally dependent on the SQL module to process Accounting
86
 
        #  packets.
87
 
        #
88
 
        #  The 'sqlmod_inst' parameter holds the instance of the sql
89
 
        #  module to use when querying the SQL database. Normally it
90
 
        #  is just "sql".  If you define more and one SQL module
91
 
        #  instance (usually for failover situations), you can
92
 
        #  specify which module has access to the Accounting Data
93
 
        #  (radacct table).
94
 
        #
95
 
        #  The 'reset' parameter defines when the counters are all
96
 
        #  reset to zero.  It can be hourly, daily, weekly, monthly or
97
 
        #  never.  It can also be user defined. It should be of the
98
 
        #  form:
99
 
        #       num[hdwm] where:
100
 
        #       h: hours, d: days, w: weeks, m: months
101
 
        #       If the letter is ommited days will be assumed. In example:
102
 
        #       reset = 10h (reset every 10 hours)
103
 
        #       reset = 12  (reset every 12 days)
104
 
        #
105
 
        #  The 'key' parameter specifies the unique identifier for the
106
 
        #  counter records (usually 'User-Name').
107
 
        #
108
 
        #  The 'query' parameter specifies the SQL query used to get
109
 
        #  the current Counter value from the database. There are 3
110
 
        #  parameters that can be used in the query:
111
 
        #               %k      'key' parameter
112
 
        #               %b      unix time value of beginning of reset period 
113
 
        #               %e      unix time value of end of reset period
114
 
        #
115
 
        #
116
 
        #  The 'check-name' parameter is the name of the 'check'
117
 
        #  attribute to use to access the counter in the 'users' file
118
 
        #  or SQL radcheck or radcheckgroup tables.
119
 
        #
120
 
        #  DEFAULT  Max-Daily-Session > 3600, Auth-Type = Reject
121
 
        #      Reply-Message = "You've used up more than one hour today"
122
 
        #
123
 
        sqlcounter dailycounter {
124
 
                counter-name = Daily-Session-Time
125
 
                check-name = Max-Daily-Session
126
 
                sqlmod-inst = sql
127
 
                key = User-Name
128
 
                reset = daily
129
 
 
130
 
                # This query properly handles calls that span from the
131
 
                # previous reset period into the current period but
132
 
                # involves more work for the SQL server than those
133
 
                # below
134
 
                query = "SELECT SUM(AcctSessionTime - GREATEST((%b - UNIX_TIMESTAMP(AcctStartTime)), 0)) FROM radacct WHERE UserName='%{%k}' AND UNIX_TIMESTAMP(AcctStartTime) + AcctSessionTime > '%b'"
135
 
 
136
 
                # This query ignores calls that started in a previous
137
 
                # reset period and continue into into this one. But it
138
 
                # is a little easier on the SQL server
139
 
                # query = "SELECT SUM(AcctSessionTime) FROM radacct WHERE UserName='%{%k}' AND AcctStartTime > FROM_UNIXTIME('%b')"
140
 
 
141
 
                # This query is the same as above, but demonstrates an
142
 
                # additional counter parameter '%e' which is the
143
 
                # timestamp for the end of the period
144
 
                # query = "SELECT SUM(AcctSessionTime) FROM radacct WHERE UserName='%{%k}' AND AcctStartTime BETWEEN FROM_UNIXTIME('%b') AND FROM_UNIXTIME('%e')"               
145
 
        }
146
 
 
147
 
        sqlcounter monthlycounter {
148
 
                counter-name = Monthly-Session-Time
149
 
                check-name = Max-Monthly-Session
150
 
                sqlmod-inst = sqlcca3
151
 
                key = User-Name
152
 
                reset = monthly
153
 
 
154
 
                # This query properly handles calls that span from the
155
 
                # previous reset period into the current period but
156
 
                # involves more work for the SQL server than those
157
 
                # below
158
 
                query = "SELECT SUM(AcctSessionTime - GREATEST((%b - UNIX_TIMESTAMP(AcctStartTime)), 0)) FROM radacct WHERE UserName='%{%k}' AND UNIX_TIMESTAMP(AcctStartTime) + AcctSessionTime > '%b'"
159
 
 
160
 
                # This query ignores calls that started in a previous
161
 
                # reset period and continue into into this one. But it
162
 
                # is a little easier on the SQL server
163
 
                # query = "SELECT SUM(AcctSessionTime) FROM radacct WHERE UserName='%{%k}' AND AcctStartTime > FROM_UNIXTIME('%b')"
164
 
 
165
 
                # This query is the same as above, but demonstrates an
166
 
                # additional counter parameter '%e' which is the
167
 
                # timestamp for the end of the period
168
 
                # query = "SELECT SUM(AcctSessionTime) FROM radacct WHERE UserName='%{%k}' AND AcctStartTime BETWEEN FROM_UNIXTIME('%b') AND FROM_UNIXTIME('%e')"               
169
 
        }
170
 
 
 
78
        #
171
79
        #  To create a dbm users file, do:
172
80
        #
173
81
        #   cat test.users | rlm_dbm_parser -f /etc/raddb/users_db
230
138
        #  and then in another module (usually the 'users' file),
231
139
        #  set 'Auth-Type := SMB'
232
140
        #
 
141
        #  WARNING: this module is not only experimental, it's also
 
142
        #  a security threat. It's not recommended to use it until
 
143
        #  it gets fixed.
 
144
        #
233
145
        smb {
234
146
                server = ntdomain.server.example.com
235
147
                backup = backup.server.example.com