Re: accounting_update_query_alt ?

2004-07-01 Thread Paul Hampson
On Thu, Jul 01, 2004 at 09:01:02AM +0400, Alexander Serkin wrote:
 Hello.
 I wonder if there're any plans to add the accounting_update_query_alt to 
 the sql configuration with INSERT?
 If not, i'll try myself.

 It is possible that the accounting update packet comes and AAA server did 
 not see start record for it. The session is not registered in this case.

It's there in the 1.0.0 series, and CVS snapshots.

-- 
Paul TBBle Hampson, on an alternate email client.

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


accounting_update_query_alt ?

2004-06-30 Thread Alexander Serkin
Hello.
I wonder if there're any plans to add the accounting_update_query_alt to the sql 
configuration with INSERT?
If not, i'll try myself.

It is possible that the accounting update packet comes and AAA server did not 
see start record for it. The session is not registered in this case.

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


RE: Accounting with Start-record missing / accounting_update_query_alt

2004-05-18 Thread Michael Markstaller
thanks Paul, 
I'll check out when upgrading the testmachine to latest cvs in a few
days..

Michael

 Yes, it was a mistake on my part An update that affects 
 no rows is not an error. I took the code from the start 
 handling, instead of from the stop handling. It should be 
 fixed now, in rlm_sql.c 1.130.
 
 -- 
 Paul TBBle Hampson, on an alternate email client.
 

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


Accounting with Start-record missing / accounting_update_query_alt

2004-05-17 Thread Michael Markstaller
Hi,

running FreeRADIUS Version 1.0.0-pre0 (Debian-package from cvs20040421)
with accounting to mysql 3.23.49.
When I understood things right, the accounting_update_query_alt should
come into action when accounting_update_query fails because no
start-record was ever inserted, right ?


However, if I'm right ;) when the start-record gets recorded, accounting
including updates works fine, but when the according row is missing in
table radacct (due to the start-record got lost or accounting started
after the session was created - ok, this is really uncommon) then
accounting_update_query_alt doens't kick in.

From what I understood the problem lies in rlm_sql not reporting an
error somehow when the update fails; complete debug-output from one
update and the stop-record below (both with changed IP's. 
The stop-record finally creates a row in radacct, so
accounting_stop_query_alt works fine.

As soon as the according start-entry in table radacct exists also the
update work fine, but I thought of this as a way to recover missing
accounting packets to at least have the updates creating records when
the start goes wrong.

regards

Michael

--- cut acct-update ---
rad_recv: Accounting-Request packet from host 1.2.3.46:1646, id=208,
length=226
Acct-Session-Id = 0012
Cisco-AVPair = isakmp-group-id=grpname
Framed-IP-Address = 1.2.3.36
Cisco-AVPair = isakmp-initator-ip=3.2.1.10
User-Name = username
Cisco-AVPair = connect-progress=Auth Open
Acct-Session-Time = 10785
Acct-Input-Octets = 1303176
Acct-Output-Octets = 1219984
Acct-Input-Packets = 10839
Acct-Output-Packets = 10839
Acct-Authentic = RADIUS
Acct-Status-Type = Alive
Cisco-NAS-Port = Dialer1
NAS-Port = 1
NAS-IP-Address = 1.2.3.46
Acct-Delay-Time = 0
rad_lowerpair:  User-Name now 'username'
  Processing the preacct section of radiusd.conf
modcall: entering group preacct for request 36
  modcall[preacct]: module preprocess returns noop for request 36
rlm_realm: No '#' in User-Name = username, looking up realm NULL
rlm_realm: No such realm NULL
  modcall[preacct]: module realmhash returns noop for request 36
rlm_realm: No '@' in User-Name = username, looking up realm NULL
rlm_realm: No such realm NULL
  modcall[preacct]: module suffix returns noop for request 36
  modcall[preacct]: module files returns noop for request 36
modcall: group preacct returns noop for request 36
  Processing the accounting section of radiusd.conf
modcall: entering group accounting for request 36
rlm_acct_unique: Hashing 'NAS-Port = 1,Client-IP-Address =
1.2.3.46,NAS-IP-Address = 1.2.3.46,Acct-Session-Id =
0012,User-Name = username'
rlm_acct_unique: Acct-Unique-Session-ID = f13ebac0de4ea35c.
  modcall[accounting]: module acct_unique returns ok for request 36
radius_xlat:  '/var/log/freeradius/radacct/1.2.3.46/detail-20040517'
rlm_detail:
/var/log/freeradius/radacct/%{Client-IP-Address}/detail-%Y%m%d expands
to /var/log/freeradius/radacct/1.2.3.46/detail-20040517
  modcall[accounting]: module detail returns ok for request 36
  modcall[accounting]: module unix returns noop for request 36
radius_xlat:  'username'
rlm_sql (sql): sql_set_user escaped user -- 'username'
radius_xlat:  'UPDATE radacct ? SET FramedIPAddress = '1.2.3.36', ?
AcctSessionTime = '10785', ? AcctInputOctets = '1303176', ?
AcctOutputOctets = '1219984' ? WHERE AcctSessionId = '0012' ? AND
UserName = 'username' ? AND NASIPAddress= '1.2.3.46''
rlm_sql (sql): Reserving sql socket id: 1
rlm_sql (sql): Released sql socket id: 1
  modcall[accounting]: module sql returns ok for request 36
radius_xlat:  '/var/log/freeradius/radutmp'
radius_xlat:  'username'
  modcall[accounting]: module radutmp returns ok for request 36

--- cut acct-stop ---
rad_recv: Accounting-Request packet from host 1.2.3.46:1646, id=230,
length=264
Acct-Session-Id = 0012
Cisco-AVPair = isakmp-group-id=grpname
Framed-IP-Address = 1.2.3.36
Cisco-AVPair = isakmp-initator-ip=3.2.1.10
User-Name = username
Acct-Authentic = RADIUS
Cisco-AVPair = connect-progress=Auth Open
Acct-Session-Time = 11376
Acct-Input-Octets = 1374720
Acct-Output-Octets = 1287360
Acct-Input-Packets = 11433
Acct-Output-Packets = 11433
Acct-Terminate-Cause = 0
Cisco-AVPair = disc-cause-ext=No Reason
Acct-Status-Type = Stop
Cisco-NAS-Port = Dialer1
NAS-Port = 1
NAS-IP-Address = 1.2.3.46
Acct-Delay-Time = 0
rad_lowerpair:  User-Name now 'username'
  Processing the preacct section of radiusd.conf
modcall: entering group preacct for request 65
  modcall[preacct]: module preprocess returns noop for request 65
rlm_realm: No '#' in User-Name = username, looking up realm NULL
rlm_realm: No such realm NULL
  modcall[preacct]: module realmhash returns noop for request 65

Re: Accounting with Start-record missing / accounting_update_query_alt

2004-05-17 Thread Paul Hampson
On Mon, May 17, 2004 at 09:03:47PM +0200, Michael Markstaller wrote:
 running FreeRADIUS Version 1.0.0-pre0 (Debian-package from cvs20040421)
 with accounting to mysql 3.23.49.
 When I understood things right, the accounting_update_query_alt should
 come into action when accounting_update_query fails because no
 start-record was ever inserted, right ?

 However, if I'm right ;) when the start-record gets recorded, accounting
 including updates works fine, but when the according row is missing in
 table radacct (due to the start-record got lost or accounting started
 after the session was created - ok, this is really uncommon) then
 accounting_update_query_alt doens't kick in.

 From what I understood the problem lies in rlm_sql not reporting an
 error somehow when the update fails; complete debug-output from one
 update and the stop-record below (both with changed IP's. 
 The stop-record finally creates a row in radacct, so
 accounting_stop_query_alt works fine.

 As soon as the according start-entry in table radacct exists also the
 update work fine, but I thought of this as a way to recover missing
 accounting packets to at least have the updates creating records when
 the start goes wrong.

Yes, it was a mistake on my part An update that affects no rows is
not an error. I took the code from the start handling, instead of from
the stop handling. It should be fixed now, in rlm_sql.c 1.130.

-- 
Paul TBBle Hampson, on an alternate email client.

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


accounting_update_query_alt

2004-01-08 Thread João Filipe Frade
Hello,

Is it possible to make the update query behave like the start and the stop queries?
And alternate update query is useful in several cases (i.e. server problems, lost 
start packets, billing, ADSL connections).

TIA,

Joao Frade

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