[RADIATOR] Logging to MSSQL-DB with SessionDatabase SQL

Lay_C rusgreib at po2.uni-stuttgart.de
Sun Jan 31 04:18:19 CST 2010


Hello,

I have the task to log all connections to a database. It's only one table
with the following columns:
SessionID, Username, IPv4Address, IPv6Address, AcctTerminateCause,
SessionStart, SessionStop, AcctInputPackets, AcctOutputPackets

I can connect to my dsn via isql, but I think it doesn't work from the
radius.cfg

The important excerpt looks like this:

<SessionDatabase SQL>
        Identifier SQLLog
        DBSource   dbi:ODBC:RADIUS
        DBUsername username
        DBAuth     password
        AddQuery   insert into Session (SessionID, Username, IPv4Address,
IPv6Address, AcctTerminateCause, SessionStart, SessionStop,
AcctInputPackets, AcctOutputPackets) values (%{Acct-Session-ID}, %u,
%{Framed-IP-Address}, '0', 'running', now(), -1, '0', '0')
        DeleteQuery UPDATE Session SET SessionStop = now(), AcctInputPackets
= %{Acct-Input-Packets},AcctOutputPackets = %{Acct-Output-Packets} WHERE
Username = %u AND SessionID = %{Acct-Session-ID}
</SessionDatabase>

My Idea was that this way I can update the Rows when the Session is closed.
But when testing the server with "radpwtst -trace -nostop -chap -user
Username -password Password -framed_ip_address 123.123.123.123 -secret
testtest" It doesn't write to the database.
I set trace in the radius.cfg to 5 but I can't see any error.

-- 
View this message in context: http://old.nabble.com/Logging-to-MSSQL-DB-with-SessionDatabase-SQL-tp27361270p27361270.html
Sent from the Radiator - General mailing list archive at Nabble.com.



More information about the radiator mailing list