Accounting data not being properly written to mySQL database.

Dave Martin freeradius at netcetera.com
Thu Dec 14 21:32:07 CET 2006


GentlePersons,

I'm in the process of converting from flat file to mySQL database for 
our RADIUS accounting.  I've modified the accounting_start_query 
entry in sql.conf to:

         accounting_start_query = "INSERT into ${acct_table1} \
         SET \
         AcctSessionId          = '%{Acct-Session-id}', \
         AcctUniqueId           = '%{Acct-Unique-Session-Id}', \
         UserName               = '%{SQL-User-Name}', \
         Realm                  = '%{Realm}', \
         NASIdentifier          = '%{NAS-Identifier}', \
         NASPortId              = '%{NAS-Port}', \
         NASPortType            = '%{NAS-Port-Type}', \
         AcctStartTime          = '%S', \
         AcctStopTime           = '0', \
         AcctSessionTime        = '0', \
         AcctAuthentic          = '%{Acct-Authentic}', \
         ConnectInfo_start      = '%{Connect-Info}', \
         ConnectInfo_stop       = '0', \
         AcctInputOctets        = '0', \
         AcctOutputOctets       = '0', \
         CalledStationId        = '%{Called-Station-Id}', \
         CallingStationId       = '%{Calling-Station-Id}', \
         AcctTerminateCause     = '', \
         ServiceType            = '%{Service-Type}', \
         FramedProtocol         = '%{Framed-Protocol}', \
         FramedIPAddress        = '%{Framed-IP-Address}', \
         AcctStartDelay         = '%{Acct-Delay-Time}', \
         AcctStopDelay          = '0', \
         XAscendDataRate        = '%{X-Ascend-Data-Rate}', \
         XAscendDisconnectCause = '%{X-Ascend-Disconnect-Cause}', \
         XAscendModemPortNo     = '%{X-Ascend-Modem-Port-No}', \
         XAscendModemShelfNo    = '%{X-Ascend-Modem-Shelf-No}', \
         XAscendModemSlotNo     = '%{X-Ascend-Modem-Slot-No}', \
         XAscendXmitRate        = '%{X-Ascend-Xmit-Rate}'"

I'm seeing all the fields written to the database as expected, but 
several of them (all the 'XAscend' parameters) are being written to 
the database as '0'.  I still have flat file logging enabled and the 
values are being written properly there in the Start records. e.g.:

Wed Dec 13 06:47:37 2006
         Event-Timestamp = "Dec 13 2006 06:47:25 PST"
         *User-Name = "*******"
         *NAS-IP-Address = 1.2.3.4
         *NAS-Identifier = "nasid"
         Ascend-Owner-IP-Addr = 0.0.0.0
         NAS-Port = 101072015
         Ascend-NAS-Port-Format = 5
         NAS-Port-Type = Async
         Service-Type = Framed-User
         Acct-Status-Type = Start
         Acct-Delay-Time = 0
         Acct-Session-Id = "521456215"
         Acct-Authentic = RADIUS
         Ascend-Auth-Delay = 240
         X-Ascend-Data-Rate = 24000
         X-Ascend-Xmit-Rate = 49333
         X-Ascend-Modem-PortNo = 192
         X-Ascend-Modem-SlotNo = 34
         X-Ascend-Modem-ShelfNo = 1
         *Calling-Station-Id = "1234567890"
         Ascend-Calling-Id-Type-Of-Num = National-Number
         Ascend-Calling-Id-Number-Plan = ISDN-Telephony
         Ascend-Calling-Id-Presentatn = Allowed
         Ascend-Calling-Id-Screening = Network-Provided
         *Called-Station-Id = "1234567890"
         X-Ascend-Data-Svc = 0
         Framed-Protocol = PPP
         *Framed-IP-Address = 1.2.3.4
         *Client-IP-Address = 1.2.3.4
         Acct-Unique-Session-Id = "90bb5c1dcbf6939d"
         *Stripped-User-Name = "user"
         Realm = "NULL"
         Timestamp = 1166021257

(fields beginning with '*' have been sanitized).

Any ideas?  Thanks!

Dave Martin
-- 
------------------------------------------------------------------------
Dave Martin                 Netcetera, Inc.            dpm at netcetera.com
------------------------------------------------------------------------



More information about the Freeradius-Users mailing list