sqlcounter does not work
Philemon Jaomalaza
philemon.jaomalaza at gmail.com
Thu Jan 10 16:52:45 CET 2019
> but can reconnecte again on the same day
<sigh> Where is the debug log for THAT?
Because the debug is the same as a first login when I reconnecta again and again and again, this is bellow :
(0) Received Access-Request Id 193 from 154.126.11.199:60760 to 154.126.32.122:1812 length 238
(0) ChilliSpot-Version = "1.3.1.4"
(0) User-Name = "abcd"
(0) CHAP-Challenge = 0x33d758aefb30edc95aafff31281e97cd
(0) CHAP-Password = 0x00d897a25804e201dde711e3a495395aec
(0) Service-Type = Login-User
(0) Acct-Session-Id = "5c373fdc00000003"
(0) Framed-IP-Address = 192.168.5.2
(0) NAS-Port-Type = Wireless-802.11
(0) NAS-Port = 3
(0) NAS-Port-Id = "00000003"
(0) Calling-Station-Id = "D0-FF-98-95-F2-93"
(0) Called-Station-Id = "00-19-3B-13-C7-7E"
(0) NAS-IP-Address = 10.0.0.0
(0) NAS-Identifier = "MGHotspot"
(0) WISPr-Logoff-URL = "http://10.0.0.0:3990/logoff"
(0) Message-Authenticator = 0x04aab2027637d1cda9963452ed1747fd
(0) # Executing section authorize from file /etc/freeradius/3.0/sites-enabled/default
(0) authorize {
(0) policy filter_username {
(0) if (&User-Name) {
(0) if (&User-Name) -> TRUE
(0) if (&User-Name) {
(0) if (&User-Name =~ / /) {
(0) if (&User-Name =~ / /) -> FALSE
(0) if (&User-Name =~ /@[^@]*@/ ) {
(0) if (&User-Name =~ /@[^@]*@/ ) -> FALSE
(0) if (&User-Name =~ /\.\./ ) {
(0) if (&User-Name =~ /\.\./ ) -> FALSE
(0) if ((&User-Name =~ /@/) && (&User-Name !~ /@(.+)\.(.+)$/)) {
(0) if ((&User-Name =~ /@/) && (&User-Name !~ /@(.+)\.(.+)$/)) -> FALSE
(0) if (&User-Name =~ /\.$/) {
(0) if (&User-Name =~ /\.$/) -> FALSE
(0) if (&User-Name =~ /@\./) {
(0) if (&User-Name =~ /@\./) -> FALSE
(0) } # if (&User-Name) = notfound
(0) } # policy filter_username = notfound
(0) [preprocess] = ok
(0) chap: &control:Auth-Type := CHAP
(0) [chap] = ok
(0) [mschap] = noop
(0) [digest] = noop
(0) suffix: Checking for suffix after "@"
(0) suffix: No '@' in User-Name = "abcd", looking up realm NULL
(0) suffix: No such realm "NULL"
(0) [suffix] = noop
(0) eap: No EAP-Message, not doing EAP
(0) [eap] = noop
(0) [files] = noop
(0) sql: EXPAND %{%{Stripped-User-Name}:-%{%{User-Name}:-DEFAULT}}
(0) sql: --> abcd
(0) sql: SQL-User-Name set to 'abcd'
rlm_sql (sql): Reserved connection (0)
(0) sql: EXPAND SELECT id, username, attribute, value, op FROM radcheck WHERE username = '%{SQL-User-Name}' ORDER BY id
(0) sql: --> SELECT id, username, attribute, value, op FROM radcheck WHERE username = 'abcd' ORDER BY id
(0) sql: Executing select query: SELECT id, username, attribute, value, op FROM radcheck WHERE username = 'abcd' ORDER BY id
(0) sql: User found in radcheck table
(0) sql: Conditional check items matched, merging assignment check items
(0) sql: Cleartext-Password := "1234"
(0) sql: Max-Daily-Session := 120
(0) sql: EXPAND SELECT id, username, attribute, value, op FROM radreply WHERE username = '%{SQL-User-Name}' ORDER BY id
(0) sql: --> SELECT id, username, attribute, value, op FROM radreply WHERE username = 'abcd' ORDER BY id
(0) sql: Executing select query: SELECT id, username, attribute, value, op FROM radreply WHERE username = 'abcd' ORDER BY id
(0) sql: EXPAND SELECT groupname FROM radusergroup WHERE username = '%{SQL-User-Name}' ORDER BY priority
(0) sql: --> SELECT groupname FROM radusergroup WHERE username = 'abcd' ORDER BY priority
(0) sql: Executing select query: SELECT groupname FROM radusergroup WHERE username = 'abcd' ORDER BY priority
(0) sql: User not found in any groups
rlm_sql (sql): Released connection (0)
rlm_sql (sql): Need 5 more connections to reach 10 spares
rlm_sql (sql): Opening additional connection (5), 1 of 27 pending slots used
rlm_sql_mysql: Starting connect to MySQL server
rlm_sql_mysql: Connected to database 'radius' on Localhost via UNIX socket, server version 10.1.37-MariaDB-0+deb9u1, protocol version 10
(0) [sql] = ok
sqlcounter_expand: 'SELECT SUM(acctsessiontime - GREATEST((1547067600 - UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username = '%{User-Name}' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '1547067600''
(0) dailycounter: EXPAND %{%{Stripped-User-Name}:-%{%{User-Name}:-DEFAULT}}
(0) dailycounter: --> abcd
(0) dailycounter: SQL-User-Name set to 'abcd'
rlm_sql (sql): Reserved connection (1)
(0) dailycounter: Executing select query: SELECT SUM(acctsessiontime - GREATEST((1547067600 - UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username = 'abcd' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '1547067600'
(0) dailycounter: NULL value in first column of result
rlm_sql (sql): Released connection (1)
(0) dailycounter: EXPAND %{sql:SELECT SUM(acctsessiontime - GREATEST((1547067600 - UNIX_TIMESTAMP(acctstarttime)), 0)) FROM radacct WHERE username = '%{User-Name}' AND UNIX_TIMESTAMP(acctstarttime) + acctsessiontime > '1547067600'}
(0) dailycounter: -->
(0) dailycounter: No integer found in result string "". May be first session, setting counter to 0
(0) dailycounter: Allowing user, &control:Max-Daily-Session value (120) is greater than counter value (0)
(0) dailycounter: Setting &reply:Session-Timeout value to 120
(0) [dailycounter] = ok
(0) monthlytrafficcounter: WARNING: Couldn't find check attribute, control:Max-Monthly-Traffic, doing nothing...
(0) [monthlytrafficcounter] = noop
(0) [expiration] = noop
(0) [logintime] = noop
(0) pap: WARNING: Auth-Type already set. Not setting to PAP
(0) [pap] = noop
(0) } # authorize = ok
(0) Found Auth-Type = CHAP
(0) # Executing group from file /etc/freeradius/3.0/sites-enabled/default
(0) Auth-Type CHAP {
(0) chap: Comparing with "known good" Cleartext-Password
(0) chap: CHAP user "abcd" authenticated successfully
(0) [chap] = ok
(0) } # Auth-Type CHAP = ok
(0) # Executing section post-auth from file /etc/freeradius/3.0/sites-enabled/default
(0) post-auth {
(0) update {
(0) No attributes updated
(0) } # update = noop
(0) sql: EXPAND .query
(0) sql: --> .query
(0) sql: Using query template 'query'
rlm_sql (sql): Reserved connection (2)
(0) sql: EXPAND %{%{Stripped-User-Name}:-%{%{User-Name}:-DEFAULT}}
(0) sql: --> abcd
(0) sql: SQL-User-Name set to 'abcd'
(0) sql: EXPAND INSERT INTO radpostauth (username, pass, reply, authdate) VALUES ( '%{SQL-User-Name}', '%{%{User-Password}:-%{Chap-Password}}', '%{reply:Packet-Type}', '%S')
(0) sql: --> INSERT INTO radpostauth (username, pass, reply, authdate) VALUES ( 'abcd', '0x00d897a25804e201dde711e3a495395aec', 'Access-Accept', '2019-01-10 15:55:39')
(0) sql: Executing query: INSERT INTO radpostauth (username, pass, reply, authdate) VALUES ( 'abcd', '0x00d897a25804e201dde711e3a495395aec', 'Access-Accept', '2019-01-10 15:55:39')
(0) sql: SQL query returned: success
(0) sql: 1 record(s) updated
rlm_sql (sql): Released connection (2)
(0) [sql] = ok
(0) [exec] = noop
(0) policy remove_reply_message_if_eap {
(0) if (&reply:EAP-Message && &reply:Reply-Message) {
(0) if (&reply:EAP-Message && &reply:Reply-Message) -> FALSE
(0) else {
(0) [noop] = noop
(0) } # else = noop
(0) } # policy remove_reply_message_if_eap = noop
(0) } # post-auth = ok
(0) Sent Access-Accept Id 193 from 154.126.32.122:1812 to 154.126.11.199:60760 length 0
(0) Session-Timeout = 120
(0) Finished request
Waking up in 4.9 seconds.
(1) Received Accounting-Request Id 5 from 154.126.11.199:57186 to 154.126.32.122:1813 length 166
(1) ChilliSpot-Version = "1.3.1.4"
(1) Attr-26.14559.10 = 0x00000002
(1) Event-Timestamp = "Jan 10 2019 15:55:39 EAT"
(1) User-Name = "abcd"
(1) Acct-Status-Type = Start
(1) Acct-Session-Id = "5c373fdc00000003"
(1) Framed-IP-Address = 192.168.5.2
(1) NAS-Port-Type = Wireless-802.11
(1) NAS-Port = 3
(1) NAS-Port-Id = "00000003"
(1) Calling-Station-Id = "D0-FF-98-95-F2-93"
(1) Called-Station-Id = "00-19-3B-13-C7-7E"
(1) NAS-IP-Address = 10.0.0.0
(1) NAS-Identifier = "MGHotspot"
(1) # Executing section preacct from file /etc/freeradius/3.0/sites-enabled/default
(1) preacct {
(1) [preprocess] = ok
(1) policy acct_unique {
(1) update request {
(1) Tmp-String-9 := "ai:"
(1) } # update request = noop
(1) if (("%{hex:&Class}" =~ /^%{hex:&Tmp-String-9}/) && ("%{string:&Class}" =~ /^ai:([0-9a-f]{32})/i)) {
(1) EXPAND %{hex:&Class}
(1) -->
(1) EXPAND ^%{hex:&Tmp-String-9}
(1) --> ^61693a
(1) if (("%{hex:&Class}" =~ /^%{hex:&Tmp-String-9}/) && ("%{string:&Class}" =~ /^ai:([0-9a-f]{32})/i)) -> FALSE
(1) else {
(1) update request {
(1) EXPAND %{md5:%{User-Name},%{Acct-Session-ID},%{%{NAS-IPv6-Address}:-%{NAS-IP-Address}},%{NAS-Identifier},%{NAS-Port-ID},%{NAS-Port}}
(1) --> 41d3a708c2bf94512685619a6457a6ac
(1) &Acct-Unique-Session-Id := 41d3a708c2bf94512685619a6457a6ac
(1) } # update request = noop
(1) } # else = noop
(1) } # policy acct_unique = noop
(1) suffix: Checking for suffix after "@"
(1) suffix: No '@' in User-Name = "abcd", looking up realm NULL
(1) suffix: No such realm "NULL"
(1) [suffix] = noop
(1) [files] = noop
(1) } # preacct = ok
(1) # Executing section accounting from file /etc/freeradius/3.0/sites-enabled/default
(1) accounting {
(1) detail: EXPAND /var/log/freeradius/radacct/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}/detail-%Y%m%d
(1) detail: --> /var/log/freeradius/radacct/154.126.11.199/detail-20190110
(1) detail: /var/log/freeradius/radacct/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}/detail-%Y%m%d expands to /var/log/freeradius/radacct/154.126.11.199/detail-20190110
(1) detail: EXPAND %t
(1) detail: --> Thu Jan 10 15:55:39 2019
(1) [detail] = ok
(1) [unix] = ok
(1) sql: EXPAND %{tolower:type.%{Acct-Status-Type}.query}
(1) sql: --> type.start.query
(1) sql: Using query template 'query'
rlm_sql (sql): Reserved connection (3)
(1) sql: EXPAND %{%{Stripped-User-Name}:-%{%{User-Name}:-DEFAULT}}
(1) sql: --> abcd
(1) sql: SQL-User-Name set to 'abcd'
(1) sql: EXPAND INSERT INTO radacct (acctsessionid, acctuniqueid, username, realm, nasipaddress, nasportid, nasporttype, acctstarttime, acctupdatetime, acctstoptime, acctsessiontime, acctauthentic, connectinfo_start, connectinfo_stop, acctinputoctets, acctoutputoctets, calledstationid, callingstationid, acctterminatecause, servicetype, framedprotocol, framedipaddress) VALUES ('%{Acct-Session-Id}', '%{Acct-Unique-Session-Id}', '%{SQL-User-Name}', '%{Realm}', '%{NAS-IP-Address}', '%{%{NAS-Port-ID}:-%{NAS-Port}}', '%{NAS-Port-Type}', FROM_UNIXTIME(%{integer:Event-Timestamp}), FROM_UNIXTIME(%{integer:Event-Timestamp}), NULL, '0', '%{Acct-Authentic}', '%{Connect-Info}', '', '0', '0', '%{Called-Station-Id}', '%{Calling-Station-Id}', '', '%{Service-Type}', '%{Framed-Protocol}', '%{Framed-IP-Address}')
(1) sql: --> INSERT INTO radacct (acctsessionid, acctuniqueid, username, realm, nasipaddress, nasportid, nasporttype, acctstarttime, acctupdatetime, acctstoptime, acctsessiontime, acctauthentic, connectinfo_start, connectinfo_stop, acctinputoctets, acctoutputoctets, calledstationid, callingstationid, acctterminatecause, servicetype, framedprotocol, framedipaddress) VALUES ('5c373fdc00000003', '41d3a708c2bf94512685619a6457a6ac', 'abcd', '', '10.0.0.0', '00000003', 'Wireless-802.11', FROM_UNIXTIME(1547124939), FROM_UNIXTIME(1547124939), NULL, '0', '', '', '', '0', '0', '00-19-3B-13-C7-7E', 'D0-FF-98-95-F2-93', '', '', '', '192.168.5.2')
(1) sql: Executing query: INSERT INTO radacct (acctsessionid, acctuniqueid, username, realm, nasipaddress, nasportid, nasporttype, acctstarttime, acctupdatetime, acctstoptime, acctsessiontime, acctauthentic, connectinfo_start, connectinfo_stop, acctinputoctets, acctoutputoctets, calledstationid, callingstationid, acctterminatecause, servicetype, framedprotocol, framedipaddress) VALUES ('5c373fdc00000003', '41d3a708c2bf94512685619a6457a6ac', 'abcd', '', '10.0.0.0', '00000003', 'Wireless-802.11', FROM_UNIXTIME(1547124939), FROM_UNIXTIME(1547124939), NULL, '0', '', '', '', '0', '0', '00-19-3B-13-C7-7E', 'D0-FF-98-95-F2-93', '', '', '', '192.168.5.2')
(1) sql: SQL query returned: success
(1) sql: 1 record(s) updated
rlm_sql (sql): Released connection (3)
(1) [sql] = ok
(1) [exec] = noop
(1) attr_filter.accounting_response: EXPAND %{User-Name}
(1) attr_filter.accounting_response: --> abcd
(1) attr_filter.accounting_response: Matched entry DEFAULT at line 12
(1) [attr_filter.accounting_response] = updated
(1) } # accounting = updated
(1) Sent Accounting-Response Id 5 from 154.126.32.122:1813 to 154.126.11.199:57186 length 0
(1) Finished request
(1) Cleaning up request packet ID 5 with timestamp +22
Waking up in 4.9 seconds.
(0) Cleaning up request packet ID 193 with timestamp +22
Ready to process requests
JMLZ
-----Message d'origine-----
De : Freeradius-Users [mailto:freeradius-users-bounces+philemon.jaomalaza=gmail.com at lists.freeradius.org] De la part de Alan DeKok
Envoyé : jeudi 10 janvier 2019 17:28
À : FreeRadius users mailing list <freeradius-users at lists.freeradius.org>
Objet : Re: sqlcounter does not work
On Jan 10, 2019, at 8:27 AM, Philemon Jaomalaza <philemon.jaomalaza at gmail.com> wrote:
>
> This is the debug output when I try to loggin the user abcd with Max-Daily-Session value (120), the user is disconnected after 120s
Good...
> but can reconnecte again on the same day
<sigh> Where is the debug log for THAT?
How do you expect me to debug a problem with no debug output?
> Need your help please,
I'm trying, but I'm about ready to give up. You're making it as difficult as possible for me to help you. I have no idea why.
Alan DeKok.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus
More information about the Freeradius-Users
mailing list