Topic: freeraius sqlcounter dailycounter
how can I make it success?
I try many time still cannot count down.
my config =>
sqlcounter dailycounter {
counter-name = Daily-Session-Time
check-name = Max-Daily-Session
reply-name = Session-Timeout
sqlmod-inst = sql
key = User-Name
reset = daily
query = "SELECT SUM(AcctSessionTime - \
GREATEST((%b - UNIX_TIMESTAMP(AcctStartTime)), 0)) \
FROM radacct WHERE UserName='%{%k}' AND \
UNIX_TIMESTAMP(AcctStartTime) + AcctSessionTime > '%b'"
}
authorize {
....
sql
dailycounter
....
}
radcheck table=>
+----+----------+-------------------+----+----------+
| id | UserName | Attribute | op | Value |
+----+----------+-------------------+----+----------+
| 1 | test | Max-Daily-Session | := | 600 |
| 7 | test | Password | := | testpass |
+----+----------+-------------------+----+----------+
when I change the order in authorize
dailycounter
sql
login fail.........
What step am I missing or wrong during config ?
And I want to ask when I uncomment both files and sql in authorize, login will be fail, after I comment one of these two, login become success, what happen?