Re: sql_log outputs truncated sql-statements

2006-06-13 Thread Nicolas Baradakis
Hans-Peter Fuchs wrote:

> Configuration of sql_log:
>
> [...]
>
> Alive = "UPDATE ${acct_table} \
>  SET FramedIPAddress = '%{Framed-IP-Address}', \
>  AcctSessionTime = '%{Acct-Session-Time}', \
>  AcctInputOctets = '%{Acct-Input-Octets}',
>  AcctOutputOctets = '%{Acct-Output-Octets}' \
>  WHERE AcctSessionId = '%{Acct-Session-Id}' \
>  AND UserName = '%{User-Name}' \
>  AND NASIPAddress= '%{NAS-IP-Address}';"

You're missing a '\' at the end of the 4th line.

-- 
Nicolas Baradakis

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


sql_log outputs truncated sql-statements

2006-06-13 Thread Hans-Peter Fuchs
I have updated to freeradius1.1.2 under linux rh as3 and want to 
use the sql_log module.

Most of the lines sql_log outputs are valid sql-statements, but there 
are also a lot of truncated lines:

INSERT INTO radacct (AcctSessionId, AcctUniqueId, UserName,  Realm ,NASIPAddress
, NASPortId, NASPortType, AcctStartTime, AcctStopTime,  AcctSessionTime, AcctAut
hentic, ConnectInfo_start, ConnectInfo_stop,  AcctInputOctets, AcctOutputOctets,
 CalledStationId, CallingStationId,  AcctTerminateCause, ServiceType, FramedProt
ocol, FramedIPAddress,  AcctStartDelay, AcctStopDelay) values('00045F05',  '13b1
c0e611f3176f', 'a2757389', 'NULL',  '172.20.24.2', '20205', 'ISDN', '2006-06-13 
14:13:28', '0', '0',  'RADIUS', '', '', '0', '0', '276760',  '2217882770', '', '
Framed-User', 'PPP',  ' ', '0', '0');
UPDATE radacct  SET FramedIPAddress = '134.95.88.79',  AcctSessionTime = '',  Ac
ctInputOctets = '',
* here is something missing 
INSERT INTO radacct (AcctSessionId, AcctUniqueId, UserName,  Realm ,NASIPAddress
, NASPortId, NASPortType, AcctStartTime, AcctStopTime,  AcctSessionTime, AcctAut
hentic, ConnectInfo_start, ConnectInfo_stop,  AcctInputOctets, AcctOutputOctets,
 CalledStationId, CallingStationId,  AcctTerminateCause, ServiceType, FramedProt
ocol, FramedIPAddress,  AcctStartDelay, AcctStopDelay) values('E964',  'b622
40b32eb6d15a', '[EMAIL PROTECTED]', 'uni-koeln.de',  '195.14.247.90', '0', 'Vi
rtual', '2006-06-13 14:13:28', '0', '0',  'RADIUS', '', '', '0', '0', '',  '', '
', 'Framed-User', 'PPP',  '134.95.91.102 ', '0', '0');

Configuration of sql_log:

sql_log {
path = ${radacctdir}/sql-relay
acct_table = "radacct"
postauth_table = "radpostauth"

#   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}','');"
#
Start = "INSERT INTO ${acct_table} (AcctSessionId, AcctUniqueId,
 UserName, \
 Realm ,NASIPAddress, NASPortId, NASPortType, AcctStartTime, AcctStopTime, \
 AcctSessionTime, AcctAuthentic, ConnectInfo_start, ConnectInfo_stop, \
 AcctInputOctets, AcctOutputOctets, CalledStationId, CallingStationId, \
 AcctTerminateCause, ServiceType, FramedProtocol, FramedIPAddress, \
 AcctStartDelay, AcctStopDelay) values('%{Acct-Session-Id}', \
 '%{Acct-Unique-Session-Id}', '%{User-Name}', '%{Realm}', \
 '%{NAS-IP-Address}', '%{NAS-Port}', '%{NAS-Port-Type}', '%S', '0', '0', \
 '%{Acct-Authentic}', '%{Connect-Info}', '', '0', '0', '%{Called-Station-Id}', \
 '%{Calling-Station-Id}', '', '%{Service-Type}', '%{Framed-Protocol}', \
 '%{Framed-IP-Address} ', '%{Acct-Delay-Time}', '0');"

Stop = "UPDATE ${acct_table} SET AcctStopTime = '%S', \
 AcctSessionTime = '%{Acct-Session-Time}', AcctInputOctets = '%{Acct-Input-Octet
s}', \
 AcctOutputOctets = '%{Acct-Output-Octets}', AcctTerminateCause = \
 '%{Acct-Terminate-Cause}', AcctStopDelay = '%{Acct-Delay-Time}', \
 ConnectInfo_stop = '%{Connect-Info}' \
 WHERE AcctSessionId = '%{Acct-Session-Id}' AND UserName = '%{User-Name}' \
 AND NASIPAddress = '%{NAS-IP-Address}' AND AcctStopTime = '0';"

Alive = "UPDATE ${acct_table} \
 SET FramedIPAddress = '%{Framed-IP-Address}', \
 AcctSessionTime = '%{Acct-Session-Time}', \
 AcctInputOctets = '%{Acct-Input-Octets}',
 AcctOutputOctets = '%{Acct-Output-Octets}' \
 WHERE AcctSessionId = '%{Acct-Session-Id}' \
 AND UserName = '%{User-Name}' \
 AND NASIPAddress= '%{NAS-IP-Address}';"

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

is this a bug or my stupidness?


Grüße

Hans-Peter Fuchs


Hans-Peter Fuchs - RZKR, Zimmer 20
Zentrum fuer angewandte Informatik - Universitaetsweiter Service RRZK
Universität