attribute Access-Period dont work
Sergio Diaz
sdiazf at logitel.com.mx
Fri May 22 00:11:12 CEST 2015
Hello Alan thank for your answer.
I fixed the erros in query. But still with the same problem, the user still connected and enjoying the internet. I hope you can help me
Here the log:
Ready to process requests.
rad_recv: Access-Request packet from host 192.16.1.6 port 63130, id=103, length=301
ChilliSpot-Version = "1.2.8"
User-Name = "513o"
CHAP-Challenge = 0x6e85aa221d45d69af8fe65258a255801
CHAP-Password = 0x004921c340cbad8a727339cb50e07f010f
Service-Type = Login-User
Acct-Session-Id = "555e563900000004"
Framed-IP-Address = 10.255.216.11
NAS-Port-Type = Wireless-802.11
NAS-Port = 4
NAS-Port-Id = "00000004"
Calling-Station-Id = "E0-06-E6-0E-4F-0B"
Called-Station-Id = "AC-86-74-1D-9B-F0"
NAS-IP-Address = 10.255.216.1
NAS-Identifier = "AP2"
WISPr-Location-ID = "isocc=,cc=,ac=,network=Coova,Wicoin_Test"
WISPr-Location-Name = "Wicoin_Test"
WISPr-Logoff-URL = "http://10.255.216.1:3990/logoff"
Message-Authenticator = 0x15e0146909189559d215c9bab309942a
# Executing section authorize from file /etc/freeradius/sites-enabled/default
+- entering group authorize {...}
++- entering policy filter_username {...}
+++? if (User-Name =~ /^ /)
? Evaluating (User-Name =~ /^ /) -> FALSE
+++? if (User-Name =~ /^ /) -> FALSE
+++? if (User-Name =~ / $$/)
? Evaluating (User-Name =~ / $$/) -> FALSE
+++? if (User-Name =~ / $$/) -> FALSE
+++? if (User-Name != "%{tolower:%{User-Name}}")
expand: %{User-Name} -> 513o
expand: %{tolower:%{User-Name}} -> 513o
? Evaluating (User-Name != "%{tolower:%{User-Name}}") -> FALSE
+++? if (User-Name != "%{tolower:%{User-Name}}") -> FALSE
++- policy filter_username returns notfound
++[preprocess] returns ok
[chap] Setting 'Auth-Type := CHAP'
++[chap] returns ok
++[mschap] returns noop
++[digest] returns noop
[suffix] No '@' in User-Name = "513o", looking up realm NULL
[suffix] No such realm "NULL"
++[suffix] returns noop
[eap] No EAP-Message, not doing EAP
++[eap] returns noop
++[files] returns noop
[sql] expand: %{User-Name} -> 513o
[sql] sql_set_user escaped user --> '513o'
rlm_sql (sql): Reserving sql socket id: 13
[sql] expand: SELECT id, username, attribute, value, op FROM radcheck WHERE username = '%{SQL-User-Name}' ORDER BY id -> SELECT id, username, attribute, value, op FROM radcheck WHERE username = '513o' ORDER BY id
[sql] User found in radcheck table
[sql] expand: SELECT id, username, attribute, value, op FROM radreply WHERE username = '%{SQL-User-Name}' ORDER BY id -> SELECT id, username, attribute, value, op FROM radreply WHERE username = '513o' ORDER BY id
[sql] expand: SELECT groupname FROM radusergroup WHERE username = '%{SQL-User-Name}' ORDER BY priority -> SELECT groupname FROM radusergroup WHERE username = '513o' ORDER BY priority
rlm_sql (sql): Released sql socket id: 13
++[sql] returns ok
++[expiration] returns noop
++[logintime] returns noop
rlm_sqlcounter: Entering module authorize code
rlm_sqlcounter: Could not find Check item value pair
++[noresetcounter] returns noop
rlm_sqlcounter: Entering module authorize code
WARNING: Please replace '%k' with '${key}'
sqlcounter_expand: 'SELECT UNIX_TIMESTAMP()- UNIX_TIMESTAMP(AcctStartTime) FROM radacct WHERE UserName = '%{User-Name}' ORDER BY AcctStartTime LIMIT 1'
[accessperiod] expand: SELECT UNIX_TIMESTAMP()- UNIX_TIMESTAMP(AcctStartTime) FROM radacct WHERE UserName = '%{User-Name}' ORDER BY AcctStartTime LIMIT 1 -> SELECT UNIX_TIMESTAMP()- UNIX_TIMESTAMP(AcctStartTime) FROM radacct WHERE UserName = '513o' ORDER BY AcctStartTime LIMIT 1
WARNING: Please replace '%S' with '${sqlmod-inst}'
sqlcounter_expand: '%{sql:SELECT UNIX_TIMESTAMP()- UNIX_TIMESTAMP(AcctStartTime) FROM radacct WHERE UserName = '513o' ORDER BY AcctStartTime LIMIT 1}'
[accessperiod] sql_xlat
[accessperiod] expand: %{User-Name} -> 513o
[accessperiod] sql_set_user escaped user --> '513o'
[accessperiod] expand: SELECT UNIX_TIMESTAMP()- UNIX_TIMESTAMP(AcctStartTime) FROM radacct WHERE UserName = '513o' ORDER BY AcctStartTime LIMIT 1 -> SELECT UNIX_TIMESTAMP()- UNIX_TIMESTAMP(AcctStartTime) FROM radacct WHERE UserName = '513o' ORDER BY AcctStartTime LIMIT 1
rlm_sql (sql): Reserving sql socket id: 12
[accessperiod] SQL query did not return any results
rlm_sql (sql): Released sql socket id: 12
[accessperiod] expand: %{sql:SELECT UNIX_TIMESTAMP()- UNIX_TIMESTAMP(AcctStartTime) FROM radacct WHERE UserName = '513o' ORDER BY AcctStartTime LIMIT 1} ->
rlm_sqlcounter: No integer found in string ""
++[accessperiod] returns noop
[pap] WARNING: Auth-Type already set. Not setting to PAP
++[pap] returns noop
Found Auth-Type = Accept
Auth-Type = Accept, accepting the user
# Executing section session from file /etc/freeradius/sites-enabled/default
+- entering group session {...}
[radutmp] expand: /var/log/freeradius/radutmp -> /var/log/freeradius/radutmp
[radutmp] expand: %{User-Name} -> 513o
++[radutmp] returns ok
# Executing section post-auth from file /etc/freeradius/sites-enabled/default
+- entering group post-auth {...}
[sql] expand: %{User-Name} -> 513o
[sql] sql_set_user escaped user --> '513o'
[sql] expand: %{User-Password} ->
[sql] ... expanding second conditional
[sql] expand: %{Chap-Password} -> 0x004921c340cbad8a727339cb50e07f010f
[sql] expand: INSERT INTO radpostauth (username, pass, reply, authdate) VALUES ( '%{User-Name}', '%{%{User-Password}:-%{Chap-Password}}', '%{reply:Packet-Type}', '%S') -> INSERT INTO radpostauth (username, pass, reply, authdate) VALUES ( '513o', '0x004921c340cbad8a727339cb50e07f010f', 'Access-Accept', '2015-05-21 17:04:03')
rlm_sql (sql) in sql_postauth: query is INSERT INTO radpostauth (username, pass, reply, authdate) VALUES ( '513o', '0x004921c340cbad8a727339cb50e07f010f', 'Access-Accept', '2015-05-21 17:04:03')
rlm_sql (sql): Reserving sql socket id: 11
rlm_sql (sql): Released sql socket id: 11
++[sql] returns ok
++[exec] returns noop
Sending Access-Accept of id 103 to 192.16.1.6 port 63130
Finished request 14.
Going to the next request
Waking up in 4.9 seconds.
rad_recv: Accounting-Request packet from host 192.16.1.6 port 60646, id=122, length=225
ChilliSpot-Version = "1.2.8"
ChilliSpot-Attr-10 = 0x00000002
Event-Timestamp = "May 21 2015 17:04:03 CDT"
Acct-Status-Type = Start
User-Name = "513o"
Acct-Session-Id = "555e563900000004"
Framed-IP-Address = 10.255.216.11
NAS-Port-Type = Wireless-802.11
NAS-Port = 4
NAS-Port-Id = "00000004"
Calling-Station-Id = "E0-06-E6-0E-4F-0B"
Called-Station-Id = "AC-86-74-1D-9B-F0"
NAS-IP-Address = 10.255.216.1
NAS-Identifier = "AP2"
WISPr-Location-ID = "isocc=,cc=,ac=,network=Coova,Wicoin_Test"
WISPr-Location-Name = "Wicoin_Test"
# Executing section preacct from file /etc/freeradius/sites-enabled/default
+- entering group preacct {...}
++[preprocess] returns ok
[acct_unique] Hashing 'NAS-Port = 4,Client-IP-Address = 192.16.1.6,NAS-IP-Address = 10.255.216.1,Acct-Session-Id = "555e563900000004",User-Name = "513o"'
[acct_unique] Acct-Unique-Session-ID = "a746f155e05debd2".
++[acct_unique] returns ok
[suffix] No '@' in User-Name = "513o", looking up realm NULL
[suffix] No such realm "NULL"
++[suffix] returns noop
++[files] returns noop
# Executing section accounting from file /etc/freeradius/sites-enabled/default
+- entering group accounting {...}
[detail] expand: %{Packet-Src-IP-Address} -> 192.16.1.6
[detail] expand: /var/log/freeradius/radacct/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}/detail-%Y%m%d -> /var/log/freeradius/radacct/192.16.1.6/detail-20150521
[detail] /var/log/freeradius/radacct/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}/detail-%Y%m%d expands to /var/log/freeradius/radacct/192.16.1.6/detail-20150521
[detail] expand: %t -> Thu May 21 17:04:03 2015
++[detail] returns ok
++[unix] returns ok
[radutmp] expand: /var/log/freeradius/radutmp -> /var/log/freeradius/radutmp
[radutmp] expand: %{User-Name} -> 513o
++[radutmp] returns ok
[sql] expand: %{User-Name} -> 513o
[sql] sql_set_user escaped user --> '513o'
[sql] expand: %{Acct-Delay-Time} ->
[sql] ... expanding second conditional
[sql] expand: INSERT INTO radacct (acctsessionid, acctuniqueid, username, realm, nasipaddress, nasportid, nasporttype, acctstarttime, acctstoptime, acctsessiontime, acctauthentic, connectinfo_start, connectinfo_stop, acctinputoctets, acctoutputoctets, calledstationid, callingstationid, acctterminatecause, servicetype, framedprotocol, framedipaddress, acctstartdelay, acctstopdelay, xascendsessionsvrkey) VALUES ('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', '%{NAS-Port}', '%{NAS-Port-Type}', '%S', NULL, '0', '%{Acct-Authentic}', '%{Connect-Info}', '', '0', '0', '%{Called-Station-Id}', '%{Calling-Station-Id}', '', '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}',
rlm_sql (sql): Reserving sql socket id: 10
rlm_sql (sql): Released sql socket id: 10
++[sql] returns ok
++[exec] returns noop
[attr_filter.accounting_response] expand: %{User-Name} -> 513o
attr_filter: Matched entry DEFAULT at line 12
++[attr_filter.accounting_response] returns updated
Sending Accounting-Response of id 122 to 192.16.1.6 port 60646
Finished request 15.
Cleaning up request 15 ID 122 with timestamp +210
Going to the next request
Waking up in 4.9 seconds.
Cleaning up request 14 ID 103 with timestamp +210
Ready to process requests.
Saludos Cordiales,
Sergio Diaz
Infraestructura TI
01(55) 5265.0145
(044) 55.28.99.95.71
sdiazf at logitel.com.mx
www.logitel.com.mx
-----Mensaje original-----
De: Freeradius-Users [mailto:freeradius-users-bounces+sdiazf=logitel.com.mx at lists.freeradius.org] En nombre de Alan DeKok
Enviado el: jueves, 21 de mayo de 2015 02:43 p. m.
Para: FreeRadius users mailing list
Asunto: Re: attribute Access-Period dont work
On May 21, 2015, at 2:17 PM, Sergio Diaz <sdiazf at logitel.com.mx> wrote:
> [accessperiod] expand: .SELECT -> .SELECT
That's not a valid SQL query.
> rlm_sql (sql): Reserving sql socket id: 23
> rlm_sql_mysql: MYSQL check_error: 2006, returning SQL_DOWN rlm_sql
> (sql): Attempting to connect rlm_sql_mysql #23
> rlm_sql_mysql: Starting connect to MySQL server for #23 rlm_sql (sql):
> Connected new DB handle, #23
> rlm_sql_mysql: MYSQL check_error: 1064 received rlm_sql (sql): failed
> after re-connect rlm_sql (sql): database query error, .SELECT: You
> have an error in your SQL syntax; check the manual that corresponds to
> your MySQL server version for the right syntax to use near '.SELECT'
> at line 1
See? It's not a valid SQL query.
Fix the "accessperiod" module configuration so that it contains a correct SQL statement.
Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
More information about the Freeradius-Users
mailing list