Query error in Acct table for Tenant_ID

Emrah Yıldırım emrah.yldrm81 at gmail.com
Wed Mar 21 14:24:48 CET 2018


hi,

The Freeradius service does not work when I add the following.

sites-enabled/default

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

accounting {

#
#  See "Accounting queries" in sql.conf

update request {
              tenant_list = %{sql:"SELECT tenant_id FROM ${client_table}
WHERE realipaddr = '%{NAS-IP-Address}'"}
        }

sql

#


----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Freeradius -X

server default { # from file /etc/freeradius/sites-enabled/default
 # Creating Auth-Type = digest
 # Loading authenticate {...}
 # Loading authorize {...}
 # Loading preacct {...}
 # Loading accounting {...}
Unknown attribute "tenant_list"
/etc/freeradius/sites-enabled/default[573]: Syntax error in attribute
definition
/etc/freeradius/sites-enabled/default[538]: Errors parsing accounting
section.


2018-03-21 15:24 GMT+03:00 Alan Buxey <alan.buxey at gmail.com>:

> hi,
>
> stop rewind.
>
> the setting of the variable would go into the main virtual_server file
> - not in the SQL config - as i said, read the unlang manual and sql
> module guide to see how these
> things work.
>
> to the SQL query in the eg accounting section BEFORE the call to sql
> in the accounting section eg
>
> accounting {
>
> ..
> ..
> ..
>
> update request {
>       tenant_list = %{sql:"SELECT tenant_id FROM ${client_table} WHERE
> realipaddr = '%{NAS-IP-Address}'"}
>      }
> ....
> sql
> ...
> }
>
> then use that variable in your UPDATE command in the SQL module
>
>
> alan
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/
> list/users.html
>


More information about the Freeradius-Users mailing list