online users not showing in fr/mysql cli
JAHANZAIB SYED
aacable at hotmail.com
Wed Mar 4 08:52:52 CET 2015
My NAS(Mikrotik) is configured to send accounting info every 1 minute (test purposes). Here is the radiusd log when it receives accounting info from the nas ...
=============================
rad_recv: Accounting-Request packet from host 101.11.11.255 port 60502, id=165, length=185
Service-Type = Framed-User
Framed-Protocol = PPP
NAS-Port = 13
NAS-Port-Type = Ethernet
User-Name = "zaib"
Calling-Station-Id = "00:0C:29:25:75:D1"
Called-Station-Id = "service1"
NAS-Port-Id = "ether1"
Acct-Session-Id = "81a00009"
Framed-IP-Address = 172.16.0.255
Acct-Authentic = RADIUS
Event-Timestamp = "Mar 4 2015 07:51:39 EST"
Acct-Session-Time = 30
Acct-Input-Octets = 1721
Acct-Input-Gigawords = 0
Acct-Input-Packets = 22
Acct-Output-Octets = 116
Acct-Output-Gigawords = 0
Acct-Output-Packets = 10
Acct-Status-Type = Interim-Update
NAS-Identifier = "MikroTik"
Acct-Delay-Time = 0
NAS-IP-Address = 101.11.11.255
# Executing section preacct from file /usr/local/etc/raddb/sites-enabled/default
+- entering group preacct {...}
++[preprocess] returns ok
[acct_unique] Hashing 'NAS-Port = 13,NAS-Identifier = "MikroTik",NAS-IP-Address = 101.11.11.255,Acct-Session-Id = "81a00009",User-Name = "zaib"'
[acct_unique] Acct-Unique-Session-ID = "94038399ad1919ea".
++[acct_unique] returns ok
[suffix] No '@' in User-Name = "zaib", looking up realm NULL
[suffix] No such realm "NULL"
++[suffix] returns noop
[files] acct_users: Matched entry DEFAULT at line 28
[files] expand: /usr/local/bin/rmacnt update %{Acct-Unique-Session-Id} "%{Acct-Output-Gigawords}" "%{Acct-Output-Octets}" "%{Acct-Input-Gigawords}" "%{Acct-Input-Octets}" -> /usr/local/bin/rmacnt update 94038399ad1919ea "0" "116" "0" "1721"
++[files] returns ok
# Executing section accounting from file /usr/local/etc/raddb/sites-enabled/default
+- entering group accounting {...}
++[unix] returns noop
rlm_sql (sql): Reserving sql socket id: 0
[sqlippool] expand: %{User-Name} -> zaib
[sqlippool] sql_set_user escaped user --> 'zaib'
[sqlippool] expand: START TRANSACTION -> START TRANSACTION
[sqlippool] expand: UPDATE radippool SET expiry_time = NOW() + INTERVAL 3600 SECOND WHERE nasipaddress = '%{Nas-IP-Address}' AND pool_key = '%{NAS-Port}' AND username = '%{User-Name}' AND callingstationid = '%{Calling-Station-Id}' AND framedipaddress = '%{Framed-IP-Address}' -> UPDATE radippool SET expiry_time = NOW() + INTERVAL 3600 SECOND WHERE nasipaddress = '101.11.11.255' AND pool_key = '13' AND username = 'zaib' AND callingstationid = '00:0C:29:25:75:D1' AND framedipaddress = '172.16.0.255'
[sqlippool] expand: COMMIT -> COMMIT
rlm_sql (sql): Released sql socket id: 0
++[sqlippool] returns ok
[sql] expand: %{User-Name} -> zaib
[sql] sql_set_user escaped user --> 'zaib'
[sql] expand: %{Acct-Input-Gigawords} -> 0
[sql] expand: %{Acct-Input-Octets} -> 1721
[sql] expand: %{Acct-Output-Gigawords} -> 0
[sql] expand: %{Acct-Output-Octets} -> 116
[sql] expand: UPDATE radacct SET framedipaddress = '%{Framed-IP-Address}', acctsessiontime = '%{Acct-Session-Time}', acctinputoctets = '%{%{Acct-Input-Gigawords}:-0}' << 32 | '%{%{Acct-Input-Octets}:-0}', acctoutputoctets = '%{%{Acct-Output-Gigawords}:-0}' << 32 | '%{%{Acct-Output-Octets}:-0}' WHERE acctsessionid = '%{Acct-Session-Id}' AND username = '%{SQL-User-Name}' AND nasipaddress = '%{NAS-IP-Address}' -> UPDATE radacct SET framedipaddress = '172.16.0.255', acctsessiontime = '30', acctinputoctets = '0' << 32 | '1721', acctoutputoctets = '0' << 32 | '116' WHERE acctsessionid = '81a00009' AND username = 'zaib' AND nasipaddre
rlm_sql (sql): Reserving sql socket id: 4
rlm_sql (sql): Released sql socket id: 4
++[sql] returns ok
++[exec] returns ok
[attr_filter.accounting_response] expand: %{User-Name} -> zaib
attr_filter: Matched entry DEFAULT at line 12
++[attr_filter.accounting_response] returns updated
Sending Accounting-Response of id 165 to 101.11.11.255 port 60502
Finished request 2.
Cleaning up request 2 ID 165 with timestamp +40
Going to the next request
Ready to process requests.
============================================================================
Subject: Re: online users not showing in fr/mysql cli
From: A.L.M.Buxey at lboro.ac.uk
Date: Wed, 4 Mar 2015 07:34:59 +0000
To: freeradius-users at lists.freeradius.org; aacable at hotmail.com; freeradius-users at lists.freeradius.org
Show us debug log when accounting packets arrive at your server. If you're NAS aren't sending accounting packets and your server isn't configured to put info from those accounting datagrams into sql then your tables will be empty and your queries will result in empty replies
alan
More information about the Freeradius-Users
mailing list