How to log Access-Accept reply attributes/values in radpostauth sql

James Wood james.wood at purplewifi.com
Thu Aug 24 23:19:14 CEST 2017


Hi All

FR 3.0.13. Everything working perfectly, including SQL (mysql) for auth/acct
logging.

When a user authenticates, I would like to log any Access-Accept reply
attributes we've set to sql (radpostauth).

For example, my typical Access-Accept looks like this:

Access-Accept (2), id: 0x2f, Authenticator: 123
          Session-Timeout Attribute (27), length: 6, Value: 86400
          Idle-Timeout Attribute (28), length: 6, Value: 600
          Acct-Interim-Interval Attribute (85), length: 6, Value: 300

Therefore, I would like to log anything that was sent back to the NAS to the
DB, in this instance:

"Session-Timeout=86400,Idle-Timeout=600,Acct-Interim-Interval=300" or some
other format as long as the data is readable...

Is that possible? I tried using something like the below in the queries
file:

post-auth {
        query = "\
                INSERT INTO ${..postauth_table} \
                        (username, pass, reply, authdate, callingstationid,
calledstationid, attributes) \
                VALUES ( \
                        '%{SQL-User-Name}', \
                        '%{%{User-Password}:-%{Chap-Password}}', \
                        '%{reply:Packet-Type}', \
                        '%S', \
                        '%{Calling-Station-Id}', \
                        '%{Called-Station-Id}', \
                        '%{reply:[*]}')"

But doesn't appar I can use %{reply[*]} in that way. 

Thanks

James





More information about the Freeradius-Users mailing list