accounting from alive packets doesn't go to sql

2004-04-02 Thread Alexander Lunyov
Hello freeradius-users,

  First of all, i'd like to thank all those people, who helped me last
  time with traffic limiting (thread "how can i limit traffic use?"),
  and special thanks to Alexander M. Pravking.

  Now, i have freebsd 4.8R-p13, freeradius-0.9.3, exppp-0.2 as a NAS and traffic
  limiting is working with that system. My NAS (exppp) able to send
  alive packets to radius, and when i enable sending alive-packets to
  radius, accounting information shows in
  /var/log/radius/radacct/${nas_ip}/detail but not affecting sql
  accounting to change. Messages appearing in detail file is something
  like:

Wed Mar 31 18:15:23 2004
Calling-Station-Id = "0:4:79:67:88:a6"
Called-Station-Id = "pppoe"
Service-Type = Framed-User
User-Name = "user"
Framed-Protocol = PPP
Framed-IP-Address = 192.168.253.239
Framed-IP-Netmask = 0.0.0.0
NAS-Identifier = "zeus.domain.ru"
NAS-Port-Type = Ethernet
NAS-Port = 304
Acct-Status-Type = Alive
Acct-Session-Id = "s--1044316270"
Acct-Multi-Session-Id = ""
Acct-Delay-Time = 0
Acct-Input-Octets = 299610
Acct-Input-Packets = 4591
Acct-Output-Octets = 3559729
Acct-Output-Packets = 7397
Acct-Session-Time = 5263
NAS-IP-Address = ip.ad.dre.ss
Client-IP-Address = ip.ad.dre.ss
Acct-Unique-Session-Id = "e71ea15b188b6941"
Timestamp = 1080742523

But it's not affecting sql :( And, while this accounting data is not shows up in
sql, traffic is leaking!

Accounting block in radiusd.conf:

accounting {
acct_unique
detail
unix
radutmp
sql
}

Or it's not possible? Please, help.


-- 
Best regards,
 Alexander  mailto:[EMAIL PROTECTED]


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


Re: accounting from alive packets doesn't go to sql

2004-04-02 Thread Jérôme Warnier
Le ven 02/04/2004 à 12:10, Alexander Lunyov a écrit :
> Hello freeradius-users,
> 
>   First of all, i'd like to thank all those people, who helped me last
>   time with traffic limiting (thread "how can i limit traffic use?"),
>   and special thanks to Alexander M. Pravking.
> 
>   Now, i have freebsd 4.8R-p13, freeradius-0.9.3, exppp-0.2 as a NAS and traffic
>   limiting is working with that system. My NAS (exppp) able to send
>   alive packets to radius, and when i enable sending alive-packets to
>   radius, accounting information shows in
>   /var/log/radius/radacct/${nas_ip}/detail but not affecting sql
>   accounting to change. Messages appearing in detail file is something
>   like:
> 
> Wed Mar 31 18:15:23 2004
> Calling-Station-Id = "0:4:79:67:88:a6"
> Called-Station-Id = "pppoe"
> Service-Type = Framed-User
> User-Name = "user"
> Framed-Protocol = PPP
> Framed-IP-Address = 192.168.253.239
> Framed-IP-Netmask = 0.0.0.0
> NAS-Identifier = "zeus.domain.ru"
> NAS-Port-Type = Ethernet
> NAS-Port = 304
> Acct-Status-Type = Alive
> Acct-Session-Id = "s--1044316270"
> Acct-Multi-Session-Id = ""
> Acct-Delay-Time = 0
> Acct-Input-Octets = 299610
> Acct-Input-Packets = 4591
> Acct-Output-Octets = 3559729
> Acct-Output-Packets = 7397
> Acct-Session-Time = 5263
> NAS-IP-Address = ip.ad.dre.ss
> Client-IP-Address = ip.ad.dre.ss
> Acct-Unique-Session-Id = "e71ea15b188b6941"
> Timestamp = 1080742523
> 
> But it's not affecting sql :( And, while this accounting data is not shows up in
> sql, traffic is leaking!
> 
> Accounting block in radiusd.conf:
> 
> accounting {
> acct_unique
> detail
> unix
> radutmp
> sql
> }
> 
> Or it's not possible? Please, help.
We are having the exact same problem, see my mail with subject
"FreeRADIUS and PostgreSQL" from Wed, 31 Mar 2004 21:44:59 +0200.
If you find a solution, please help.

-- 
Jérôme Warnier
Consultant
BeezNest
http://beeznest.net


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


Re: accounting from alive packets doesn't go to sql

2004-04-06 Thread Alexander Lunyov
Hello Alexander,

Friday, April 2, 2004, 2:10:25 PM, you wrote:

AL> Hello freeradius-users,

AL>   First of all, i'd like to thank all those people, who helped me last
AL>   time with traffic limiting (thread "how can i limit traffic use?"),
AL>   and special thanks to Alexander M. Pravking.

AL>   Now, i have freebsd 4.8R-p13, freeradius-0.9.3, exppp-0.2 as a NAS and traffic
AL>   limiting is working with that system. My NAS (exppp) able to send
AL>   alive packets to radius, and when i enable sending alive-packets to
AL>   radius, accounting information shows in
AL>   /var/log/radius/radacct/${nas_ip}/detail but not affecting sql
AL>   accounting to change. Messages appearing in detail file is something
AL>   like:

[skip]

AL> But it's not affecting sql :( And, while this accounting data is not shows up 
in
AL> sql, traffic is leaking!

   While searching message base of this list i found thread
   "accounting_update_query". Is this query in sql.conf responsible
   for traffic updates (by Alive packets, i mean)? If it so, why
   default update_query does not include traffic and time update
   fields? May it be a cause of my problem?

-- 
Best regards,
 Alexandermailto:[EMAIL PROTECTED]


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


Re: accounting from alive packets doesn't go to sql

2004-04-06 Thread Alexander M. Pravking
On Tue, Apr 06, 2004 at 10:13:01PM +0400, Alexander Lunyov wrote:
> AL> But it's not affecting sql :( And, while this accounting data is not shows 
> up in
> AL> sql, traffic is leaking!
> 
>While searching message base of this list i found thread
>"accounting_update_query". Is this query in sql.conf responsible
>for traffic updates (by Alive packets, i mean)?

Yes.

>If it so, why
>default update_query does not include traffic and time update
>fields? May it be a cause of my problem?

Looks like your sql config is too old, current configs (mysql/pg/oracle)
do update Acct*Octets. But that's not the main problem, I think: you
should have seen at least update of AcctSessionTime.

Could you show the debug output for an Alive packet?


-- 
Fduch M. Pravking

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


Re: accounting from alive packets doesn't go to sql

2004-04-06 Thread Alexander M. Pravking
On Wed, Apr 07, 2004 at 12:36:30AM +0400, Alexander Lunyov wrote:

> >>If it so, why
> >>default update_query does not include traffic and time update
> >>fields? May it be a cause of my problem?
> AMP> Looks like your sql config is too old, current configs (mysql/pg/oracle)
> AMP> do update Acct*Octets.
> 
>  "Current" means "cvs"? I have freeradius-0.9.3 configs.

Yes.

> AMP> But that's not the main problem, I think: you
> AMP> should have seen at least update of AcctSessionTime.
> 
>  In my case i don't need SessionTime at all, traffic is the main
>  objective.
> 
> AMP> Could you show the debug output for an Alive packet?
> 
>  Well, it looks something like this:

Oh, no. Not the detail'ed entry, but the output from radiusd -X


-- 
Fduch M. Pravking

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


Re: accounting from alive packets doesn't go to sql

2004-04-06 Thread Alexander M. Pravking
On Wed, Apr 07, 2004 at 01:20:31AM +0400, Alexander Lunyov wrote:
> Hello Alexander,
> 
> Wednesday, April 7, 2004, 12:40:59 AM, you wrote:
> 
> >> AMP> Could you show the debug output for an Alive packet?
> >> 
> >>  Well, it looks something like this:
> 
> AMP> Oh, no. Not the detail'ed entry, but the output from radiusd -X
> 
>  Oops :)
> 
>  Here it is.

(skipped)
> radius_xlat:  'UPDATE radacct SET FramedIPAddress = '192.168.253.78'
> WHERE AcctSessionId = 's--493869700' AND UserName = 'lan'
> AND NASIPAddress= '1.1.1.1' AND AcctStopTime = 0'
> rlm_sql (sql): Reserving sql socket id: 3
> rlm_sql (sql): Released sql socket id: 3
>   modcall[accounting]: module "sql" returns ok for request 2

Oops :)
Really, too old query, as you can see. Try one from current CVS,
and don't forget about Acct-*-Gigawords, see postgresql.conf.
(You're using mysql, aren't you?)

-- 
Fduch M. Pravking

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


Re[2]: accounting from alive packets doesn't go to sql

2004-04-02 Thread Alexander Lunyov
Hello Jérôme,

Friday, April 2, 2004, 7:15:03 PM, you wrote:

JW> Le ven 02/04/2004 à 12:10, Alexander Lunyov a écrit :
>> Hello freeradius-users,
>> 
>>   First of all, i'd like to thank all those people, who helped me last
>>   time with traffic limiting (thread "how can i limit traffic use?"),
>>   and special thanks to Alexander M. Pravking.
>> 
>>   Now, i have freebsd 4.8R-p13, freeradius-0.9.3, exppp-0.2 as a NAS and traffic
>>   limiting is working with that system. My NAS (exppp) able to send
>>   alive packets to radius, and when i enable sending alive-packets to
>>   radius, accounting information shows in
>>   /var/log/radius/radacct/${nas_ip}/detail but not affecting sql
>>   accounting to change. Messages appearing in detail file is something
>>   like:

[skip]

>> But it's not affecting sql :( And, while this accounting data is not shows up in
>> sql, traffic is leaking!
>> 
>> Accounting block in radiusd.conf:
>> 
>> accounting {
>> acct_unique
>> detail
>> unix
>> radutmp
>> sql
>> }
>> 
>> Or it's not possible? Please, help.
JW> We are having the exact same problem, see my mail with subject
JW> "FreeRADIUS and PostgreSQL" from Wed, 31 Mar 2004 21:44:59 +0200.

No, in my case the problem is occures only with Alive packets, and
when radius receives Stop packet - it's ok, he put accounting data
in sql normally. So i think it's not the same problem.

-- 
Best regards,
 Alexandermailto:[EMAIL PROTECTED]


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


Re[4]: accounting from alive packets doesn't go to sql

2004-04-02 Thread Alexander Lunyov
Hello Jérôme,

Friday, April 2, 2004, 8:18:33 PM, you wrote:

>> JW> We are having the exact same problem, see my mail with subject
>> JW> "FreeRADIUS and PostgreSQL" from Wed, 31 Mar 2004 21:44:59 +0200.
>> 
>> No, in my case the problem is occures only with Alive packets, and
>> when radius receives Stop packet - it's ok, he put accounting data
>> in sql normally. So i think it's not the same problem.
JW> Could you tell me what a "ldd /usr/sbin/freeradius" tells you then,
JW> please?

Here you go

# ldd /usr/local/sbin/radpppd
/usr/local/sbin/radpppd:
libcrypt.so.2 => /usr/lib/libcrypt.so.2 (0x2807e000)
libutil.so.3 => /usr/lib/libutil.so.3 (0x28097000)
libmd.so.2 => /usr/lib/libmd.so.2 (0x280a)
libpcap.so.2 => /usr/lib/libpcap.so.2 (0x280a9000)
libradius.so.1 => /usr/lib/libradius.so.1 (0x280c5000)
libc.so.4 => /usr/lib/libc.so.4 (0x280ca000)

JW> Optionally, could you provide us your current configuration, so that we
JW> could compare?

In attachment, hope this will help you.
And i hope someone will help me :)
Once again - we talking about Alive packets and sql accounting :)

-- 
Best regards,
 Alexandermailto:[EMAIL PROTECTED]

rad_cfg.tar.gz
Description: GNU Zip compressed data


Re[2]: accounting from alive packets doesn't go to sql

2004-04-06 Thread Alexander Lunyov
Hello Alexander,

Wednesday, April 7, 2004, 12:10:16 AM, you wrote:

>>While searching message base of this list i found thread
>>"accounting_update_query". Is this query in sql.conf responsible
>>for traffic updates (by Alive packets, i mean)?
AMP> Yes.
>>If it so, why
>>default update_query does not include traffic and time update
>>fields? May it be a cause of my problem?
AMP> Looks like your sql config is too old, current configs (mysql/pg/oracle)
AMP> do update Acct*Octets.

 "Current" means "cvs"? I have freeradius-0.9.3 configs.

AMP> But that's not the main problem, I think: you
AMP> should have seen at least update of AcctSessionTime.

 In my case i don't need SessionTime at all, traffic is the main
 objective.

AMP> Could you show the debug output for an Alive packet?

 Well, it looks something like this:

Wed Mar 31 18:14:31 2004
Calling-Station-Id = "0:50:ba:c1:3:38"
Called-Station-Id = "pppoe"
Service-Type = Framed-User
User-Name = "lan"
Framed-Protocol = PPP
Framed-IP-Address = 192.168.253.31
Framed-IP-Netmask = 0.0.0.0
NAS-Identifier = "zeus.domain.ru"
NAS-Port-Type = Ethernet
NAS-Port = 278
Acct-Status-Type = Alive
Acct-Session-Id = "s-1822761248"
Acct-Multi-Session-Id = ""
Acct-Delay-Time = 0
Acct-Input-Octets = 3738134
Acct-Input-Packets = 49861
Acct-Output-Octets = 23941328
Acct-Output-Packets = 82305
Acct-Session-Time = 11996
NAS-IP-Address = z.z.z.z
Client-IP-Address = z.z.z.z
Acct-Unique-Session-Id = "9e5cc2b82380453a"
Timestamp = 1080742471


-- 
Best regards,
 Alexandermailto:[EMAIL PROTECTED]


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


Re[2]: accounting from alive packets doesn't go to sql

2004-04-06 Thread Alexander Lunyov
Hello Alexander,

Wednesday, April 7, 2004, 12:40:59 AM, you wrote:

>> AMP> Could you show the debug output for an Alive packet?
>> 
>>  Well, it looks something like this:

AMP> Oh, no. Not the detail'ed entry, but the output from radiusd -X

 Oops :)

 Here it is.

--- Walking the entire request list ---
Cleaning up request 0 ID 27 with timestamp 40731de8
Cleaning up request 1 ID 109 with timestamp 40731de8
Nothing to do.  Sleeping until we see a request.
rad_recv: Accounting-Request packet from host 1.1.1.1:2719, id=251, length=162
Calling-Station-Id = "0:50:ba:c1:3:38"
Called-Station-Id = "pppoe"
Service-Type = Framed-User
User-Name = "lan"
Framed-Protocol = PPP
Framed-IP-Address = 192.168.253.78
Framed-IP-Netmask = 0.0.0.0
NAS-Identifier = "zeus.domain.ru"
NAS-Port-Type = Ethernet
NAS-Port = 926
Acct-Status-Type = Alive
Acct-Session-Id = "s--493869700"
Acct-Multi-Session-Id = ""
Acct-Delay-Time = 0
Acct-Input-Octets = 30726
Acct-Input-Packets = 128
Acct-Output-Octets = 32668
--- Walking the entire request list ---
Acct-Session-Time = 61
rad_lowerpair:  User-Name now 'lan'
modcall: entering group preacct for request 2
  modcall[preacct]: module "preprocess" returns noop for request 2
rlm_realm: No '@' in User-Name = "lan", looking up realm NULL
rlm_realm: No such realm "NULL"
  modcall[preacct]: module "suffix" returns noop for request 2
  modcall[preacct]: module "files" returns noop for request 2
modcall: group preacct returns noop for request 2
modcall: entering group accounting for request 2
rlm_acct_unique: WARNING: Attribute NAS-Port-Id was not found in request, unique ID 
MAY be inconsistent
rlm_acct_unique: Hashing ',Client-IP-Address = 1.1.1.1,NAS-IP-Address
= 1.1.1.1,Acct-Session-Id = "s--493869700",User-Name = "lan"'
rlm_acct_unique: Acct-Unique-Session-ID = "520327ed9886561d".
  modcall[accounting]: module "acct_unique" returns ok for request 2
radius_xlat:  '/var/log/radius/radacct/1.1.1.1/detail'
rlm_detail: %A/%{Client-IP-Address}/detail expands to 
/var/log/radius/radacct/1.1.1.1/detail
  modcall[accounting]: module "detail" returns ok for request 2
  modcall[accounting]: module "unix" returns noop for request 2
radius_xlat:  '/var/log/radius/radutmp'
radius_xlat:  'lan'
  modcall[accounting]: module "radutmp" returns ok for request 2
radius_xlat:  'lan'
rlm_sql (sql): sql_set_user escaped user --> 'lan'
radius_xlat:  'UPDATE radacct SET FramedIPAddress = '192.168.253.78'
WHERE AcctSessionId = 's--493869700' AND UserName = 'lan'
AND NASIPAddress= '1.1.1.1' AND AcctStopTime = 0'
rlm_sql (sql): Reserving sql socket id: 3
rlm_sql (sql): Released sql socket id: 3
  modcall[accounting]: module "sql" returns ok for request 2
modcall: group accounting returns ok for request 2
Sending Accounting-Response of id 251 to 1.1.1.1:2719
Finished request 2
Going to the next request
--- Walking the entire request list ---
Waking up in 6 seconds...
--- Walking the entire request list ---
Cleaning up request 2 ID 251 with timestamp 40731e25
Nothing to do.  Sleeping until we see a request.  

 
-- 
Best regards,
 Alexandermailto:[EMAIL PROTECTED]


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


Re[2]: accounting from alive packets doesn't go to sql

2004-04-06 Thread Alexander Lunyov
Hello Alexander,

Wednesday, April 7, 2004, 1:31:53 AM, you wrote:

>> >> AMP> Could you show the debug output for an Alive packet?
>> >> 
>> >>  Well, it looks something like this:
>> 
>> AMP> Oh, no. Not the detail'ed entry, but the output from radiusd -X
>> 
>>  Oops :)
>> 
>>  Here it is.

AMP> (skipped)
>> radius_xlat:  'UPDATE radacct SET FramedIPAddress = '192.168.253.78'
>> WHERE AcctSessionId = 's--493869700' AND UserName = 'lan'
>> AND NASIPAddress= '1.1.1.1' AND AcctStopTime = 0'
>> rlm_sql (sql): Reserving sql socket id: 3
>> rlm_sql (sql): Released sql socket id: 3
>>   modcall[accounting]: module "sql" returns ok for request 2
AMP> Oops :)
AMP> Really, too old query, as you can see. Try one from current CVS,
AMP> and don't forget about Acct-*-Gigawords, see postgresql.conf.
AMP> (You're using mysql, aren't you?)

 Yes, i'm using mysql, but what about Gigawords? What it is?

-- 
Best regards,
 Alexandermailto:[EMAIL PROTECTED]


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


Re[2]: accounting from alive packets doesn't go to sql

2004-04-06 Thread Alexander Lunyov
Hello Alexander,

Wednesday, April 7, 2004, 1:31:53 AM, you wrote:

AMP> Oops :)
AMP> Really, too old query, as you can see. Try one from current CVS,
AMP> and don't forget about Acct-*-Gigawords, see postgresql.conf.
AMP> (You're using mysql, aren't you?)

 I took latest cvs version of sql.conf and - miracle! - Alive
 accounting goes to sql now! Thanks everybody! :)


-- 
Best regards,
 Alexandermailto:[EMAIL PROTECTED]


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


Re: Re[2]: accounting from alive packets doesn't go to sql

2004-04-02 Thread Jérôme Warnier
Le ven 02/04/2004 à 18:15, Alexander Lunyov a écrit :
> Hello Jérôme,
> 
> Friday, April 2, 2004, 7:15:03 PM, you wrote:
> 
> JW> Le ven 02/04/2004 à 12:10, Alexander Lunyov a écrit :
> >> Hello freeradius-users,
> >> 
> >>   First of all, i'd like to thank all those people, who helped me last
> >>   time with traffic limiting (thread "how can i limit traffic use?"),
> >>   and special thanks to Alexander M. Pravking.
> >> 
> >>   Now, i have freebsd 4.8R-p13, freeradius-0.9.3, exppp-0.2 as a NAS and traffic
> >>   limiting is working with that system. My NAS (exppp) able to send
> >>   alive packets to radius, and when i enable sending alive-packets to
> >>   radius, accounting information shows in
> >>   /var/log/radius/radacct/${nas_ip}/detail but not affecting sql
> >>   accounting to change. Messages appearing in detail file is something
> >>   like:
> 
> [skip]
> 
> >> But it's not affecting sql :( And, while this accounting data is not shows up 
> >> in
> >> sql, traffic is leaking!
> >> 
> >> Accounting block in radiusd.conf:
> >> 
> >> accounting {
> >> acct_unique
> >> detail
> >> unix
> >> radutmp
> >> sql
> >> }
> >> 
> >> Or it's not possible? Please, help.
> JW> We are having the exact same problem, see my mail with subject
> JW> "FreeRADIUS and PostgreSQL" from Wed, 31 Mar 2004 21:44:59 +0200.
> 
> No, in my case the problem is occures only with Alive packets, and
> when radius receives Stop packet - it's ok, he put accounting data
> in sql normally. So i think it's not the same problem.
Could you tell me what a "ldd /usr/sbin/freeradius" tells you then,
please?
Optionally, could you provide us your current configuration, so that we
could compare?

Thanks.
-- 
Jérôme Warnier
Consultant
BeezNest
http://beeznest.net


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


Re: Re[4]: accounting from alive packets doesn't go to sql

2004-04-04 Thread Jérôme Warnier
Le ven 02/04/2004 à 19:04, Alexander Lunyov a écrit :
> Hello Jérôme,
> 
> Friday, April 2, 2004, 8:18:33 PM, you wrote:
> 
> >> JW> We are having the exact same problem, see my mail with subject
> >> JW> "FreeRADIUS and PostgreSQL" from Wed, 31 Mar 2004 21:44:59 +0200.
> >> 
> >> No, in my case the problem is occures only with Alive packets, and
> >> when radius receives Stop packet - it's ok, he put accounting data
> >> in sql normally. So i think it's not the same problem.
> JW> Could you tell me what a "ldd /usr/sbin/freeradius" tells you then,
> JW> please?
> 
> Here you go
> 
> # ldd /usr/local/sbin/radpppd
> /usr/local/sbin/radpppd:
> libcrypt.so.2 => /usr/lib/libcrypt.so.2 (0x2807e000)
> libutil.so.3 => /usr/lib/libutil.so.3 (0x28097000)
> libmd.so.2 => /usr/lib/libmd.so.2 (0x280a)
> libpcap.so.2 => /usr/lib/libpcap.so.2 (0x280a9000)
> libradius.so.1 => /usr/lib/libradius.so.1 (0x280c5000)
> libc.so.4 => /usr/lib/libc.so.4 (0x280ca000)
I have the same kind of dependencies, though I realized that the DB
librairies are plugins, and are not linked into the main program.

> JW> Optionally, could you provide us your current configuration, so that we
> JW> could compare?
> 
> In attachment, hope this will help you.
> And i hope someone will help me :)
> Once again - we talking about Alive packets and sql accounting :)
It is working now, thanks to every people that helped.
It seems now that FreeRADIUS is not giving acknowledgment to our Cisco
routers. I'm going to search that.

-- 
Jérôme Warnier
Consultant
BeezNest
http://beeznest.net


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