SQL log accounting and post_auth

Guillaume Chartrand guillaume.chartrand at Collanaud.Qc.Ca
Wed Apr 16 21:12:36 CEST 2008


>Hi,

>> So for this, now it's working. But I have nothing in radacct table
and even if I only keep the sql_log in the >>accounting section, i have
nothing in my sql-relay file.

>to get the sql-relay file you will need to call sql_log in the
accounting
>stanza and ensure that the sql_log is configured in the main server.
It's my accounting section
accounting {
	sql_log
      #  Filter attributes from the accounting response.
      attr_filter.accounting_response
}
And in radiusd.conf
	        sql_log {
                path = "${radacctdir}/sql-relay"
                acct_table = "radacct"
                postauth_table = "radpostauth"
                sql_user_name = "%{%{User-Name}:-DEFAULT}"
                Start = "INSERT INTO ${acct_table} (AcctSessionId,
UserName, \
                 NASIPAddress, FramedIPAddress, AcctStartTime,
AcctStopTime, \
                 AcctSessionTime, AcctTerminateCause) VALUES
\
                 ('%{Acct-Session-Id}', '%{User-Name}',
'%{NAS-IP-Address}', \
                 '%{Framed-IP-Address}', '%S', '0', '0', '');"
                Stop = "INSERT INTO ${acct_table} (AcctSessionId,
UserName,  \
                 NASIPAddress, FramedIPAddress, AcctStartTime,
AcctStopTime, \
                 AcctSessionTime, AcctTerminateCause) VALUES
\
                 ('%{Acct-Session-Id}', '%{User-Name}',
'%{NAS-IP-Address}', \
                 '%{Framed-IP-Address}', '0', '%S',
'%{Acct-Session-Time}',  \
                 '%{Acct-Terminate-Cause}');"
                Alive = "INSERT INTO ${acct_table} (AcctSessionId,
UserName, \
                 NASIPAddress, FramedIPAddress, AcctStartTime,
AcctStopTime, \
                 AcctSessionTime, AcctTerminateCause) VALUES
\
                 ('%{Acct-Session-Id}', '%{User-Name}',
'%{NAS-IP-Address}', \
                 '%{Framed-IP-Address}', '0', '0',
'%{Acct-Session-Time}','');"

                Post-Auth = "INSERT INTO ${postauth_table}
\
                 (username, pass, reply, authdate) VALUES
\
                 ('%{User-Name}', '%{User-Password:-Chap-Password}',
\
                 '%{reply:Packet-Type}', '%S');"
        }

So it's defined in radiusd.conf and called in accounting section. What
I'm missing?

>> For the post_auth it can be userful to other person if it's
integrated to the next update of freeradius.

>noted - fix and updated has been submitted as bug 545
Just for notice, I have again the warning in debug mode when I do the
post_auth queries
rlm_sql (sql): Processing sql_postauth
        expand: %{User-Name} -> guillaume
rlm_sql (sql): sql_set_user escaped user --> 'guillaume'
WARNING: Deprecated conditional expansion ":-".  See "man unlang" for
details
        expand: INSERT INTO radpostauth (username, pass, reply) VALUES
('%{User-Name}',
'%{User-Password:-Chap-Password}','%{reply:Packet-Type}') -> INSERT INTO
radpostauth (username, pass, reply) VALUES ('guillaume',
'Chap-Password','Access-Accept')
        expand: /usr/local/var/log/radius/sqltrace.sql ->
/usr/local/var/log/radius/sqltrace.sql

And I don't know what is it. And it's fot the post_auth. The post_auth
have just this
post-auth {
	sql
}

Thank again

>alan
>-
>List info/subscribe/unsubscribe? See
http://www.freeradius.org/list/users.html




More information about the Freeradius-Users mailing list