Re: Problem "expand: %{Acct-Input-Gigawords} ->" always get nothing!

2011-09-27 Thread Alexandre Chapellon



Le 27/09/2011 10:21, Arran Cudbard-Bell a écrit :
Also... Whilst it is a very pretty signature Mr Chapellon I direct you 
to the rules of the FreeRADIUS users list...


http://freeradius.org/list/users.html

The Second rule of the FreeRADIUS users list - 'No HTML on the list'
The Third rule of the FreeRADIUS users list - 'No vcards'


thank you for the reminder.


-Arran

Arran Cudbard-Bell
a.cudba...@freeradius.org 

Betelwiki, Betelwiki, Betelwikihttp://wiki.freeradius.org/ !



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


--


Alexandre Chapellon

Ingénierie des systèmes open sources et réseaux.
Follow me on twitter: @alxgomz 

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


Re: Problem "expand: %{Acct-Input-Gigawords} ->" always get nothing!

2011-09-27 Thread Arran Cudbard-Bell

On 27 Sep 2011, at 11:09, snan4love wrote:

> Hello Arran:
> Here is a stop request at the bottom of that debug information.
> 
> And something more confusing,
> I used the user name "snan4love" log in my system for hundreds time, there
> is only one time, I get the currect response with Acct-Input-Octets and
> Acct-Output-Octets .
> 

Wow, thats impressively broken, the NAS should send the same User-Name value in 
Stop/Interim-Update and Start packets. Ok so many NAS are broken in a different 
way in that they don't use unique Acct-Session-ID values (they get reset when 
the NAS reboots), so FreeRADIUS creates a hash in the Acct-Unique-Session-ID 
attribute, using other attributes from the request like the User-Name.

If the User-Name changes between stops and starts, even though the 
Acct-Session-ID matches the SQL module will not update the correct record in 
your SQL database, because the Acct-Unique-Session-ID value will be different.

There are a few ways to fix this, the easiest is to remove the User-Name 
attribute from the acct_unique module.

1) Edit

raddb/modules/acct_unique {
key = ...
}

and remove the User-Name attribute

2) Build the current GIT Master Head, look in policy.conf, there's an alternate 
way of calculating the Acct-Unique-Session-ID using the class attribute

3) Complain to your vendor and get this to fix your buggy NAS (what is the make 
and model incidentally?)

My suspicion is that the attributes are being included, but you're just looking 
at the debug from Start packets which don't contain the relevant attributes, 
and you're not seeing the values in your database because the SQL module is 
creating duplicate rows.

-Arran

Arran Cudbard-Bell
a.cudba...@freeradius.org

Betelwiki, Betelwiki, Betelwiki http://wiki.freeradius.org/ !


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


Re: Problem "expand: %{Acct-Input-Gigawords} ->" always get nothing!

2011-09-27 Thread snan4love
Hello Arran:
Here is a stop request at the bottom of that debug information.

And something more confusing,
I used the user name "snan4love" log in my system for hundreds time, there
is only one time, I get the currect response with Acct-Input-Octets and
Acct-Output-Octets .

Here is the log information:

This is the only time ,i get the correct data, at the STOP request, the
username changed.

Thu Sep 22 15:35:18 2011
Acct-Session-Id = "386D4387-0008"
Acct-Status-Type = Start
Acct-Authentic = RADIUS
User-Name = "snan4love"
NAS-IP-Address = 192.168.0.143
NAS-Identifier = "AP"
NAS-Port = 0
Called-Station-Id = "00-80-48-6E-1A-87:143"
Calling-Station-Id = "00-1E-65-50-D4-EA"
NAS-Port-Type = Wireless-802.11
Connect-Info = "CONNECT 11Mbps 802.11b"
Acct-Unique-Session-Id = "f6139abfb9132394"
Timestamp = 1316676918

Thu Sep 22 15:37:11 2011
Acct-Session-Id = "386D4387-0008"
Acct-Status-Type = Stop
Acct-Authentic = RADIUS
User-Name = "host/20101022-1029"
NAS-IP-Address = 192.168.0.143
NAS-Identifier = "AP"
NAS-Port = 0
Called-Station-Id = "00-80-48-6E-1A-87:143"
Calling-Station-Id = "00-1E-65-50-D4-EA"
NAS-Port-Type = Wireless-802.11
Connect-Info = "CONNECT 11Mbps 802.11b"
Acct-Session-Time = 113
Acct-Input-Packets = 81
Acct-Output-Packets = 7
Acct-Input-Octets = 3036
Acct-Output-Octets = 2290
Event-Timestamp = "Jan  1 2000 14:13:47 CST"
Acct-Unique-Session-Id = "a1815b5b9e77a40d"
Timestamp = 1316677031

The following is the normal no Acct-Output(Input)-Octets log:
Thu Sep 22 15:39:11 2011
Acct-Session-Id = "386D4387-000B"
Acct-Status-Type = Start
Acct-Authentic = RADIUS
User-Name = "snan4love"
NAS-IP-Address = 192.168.0.143
NAS-Identifier = "AP"
NAS-Port = 0
Called-Station-Id = "00-80-48-6E-1A-87:143"
Calling-Station-Id = "00-1E-65-50-D4-EA"
NAS-Port-Type = Wireless-802.11
Connect-Info = "CONNECT 11Mbps 802.11b"
Acct-Unique-Session-Id = "02a52d5fc2ac00e6"
Timestamp = 1316677151

Thu Sep 22 15:39:22 2011
Acct-Session-Id = "386D4387-000B"
Acct-Status-Type = Stop
Acct-Authentic = RADIUS
User-Name = "snan4love"
NAS-IP-Address = 192.168.0.143
NAS-Identifier = "AP"
NAS-Port = 0
Called-Station-Id = "00-80-48-6E-1A-87:143"
Calling-Station-Id = "00-1E-65-50-D4-EA"
NAS-Port-Type = Wireless-802.11
Connect-Info = "CONNECT 11Mbps 802.11b"
    Acct-Session-Time = 11
    Event-Timestamp = "Jan  1 2000 14:15:58 CST"
Acct-Terminate-Cause = User-Request
Acct-Unique-Session-Id = "02a52d5fc2ac00e6"
Timestamp = 1316677162




--
View this message in context: 
http://freeradius.1045715.n5.nabble.com/Problem-expand-Acct-Input-Gigawords-always-get-nothing-tp4844371p4844607.html
Sent from the FreeRadius - User mailing list archive at Nabble.com.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: Problem "expand: %{Acct-Input-Gigawords} ->" always get nothing!

2011-09-27 Thread Alan DeKok
snan4love wrote:
> Yes,I checked the entire debug output, there is no attribute about the
> Acct-Input-Octets in the accounting-Request packet.
> And here is my stupid question again:
> How to add it?

http://wiki.freeradius.org/FAQ#How+do+I+enable+FreeRADIUS+to+log+accounting+attribute+type+X%3F

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


Re: Problem "expand: %{Acct-Input-Gigawords} ->" always get nothing!

2011-09-27 Thread Arran Cudbard-Bell

On 27 Sep 2011, at 10:52, Arran Cudbard-Bell wrote:

> 
> On 27 Sep 2011, at 10:47, snan4love wrote:
> 
>> Yes,I checked the entire debug output, there is no attribute about the
>> Acct-Input-Octets in the accounting-Request packet.
>> And here is my stupid question again:
>> How to add it?
> 
> 
> By configuring the NAS to send it... Or by getting a new NAS. The RADIUS 
> server doesn't tell the NAS what attributes to send...

Incidentally the Acct-Input-Octets / Acct-Output-Octets attributes are only 
usually sent in Accounting Interim-Update and Accounting-Stop packets... The 
debug your provided was for an Accounting-Start packet...

Arran Cudbard-Bell
a.cudba...@freeradius.org

Betelwiki, Betelwiki, Betelwiki http://wiki.freeradius.org/ !


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


Re: Problem "expand: %{Acct-Input-Gigawords} ->" always get nothing!

2011-09-27 Thread Arran Cudbard-Bell

On 27 Sep 2011, at 10:47, snan4love wrote:

> Yes,I checked the entire debug output, there is no attribute about the
> Acct-Input-Octets in the accounting-Request packet.
> And here is my stupid question again:
> How to add it?


By configuring the NAS to send it... Or by getting a new NAS. The RADIUS server 
doesn't tell the NAS what attributes to send...


Arran Cudbard-Bell
a.cudba...@freeradius.org

Betelwiki, Betelwiki, Betelwiki http://wiki.freeradius.org/ !


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


Re: Problem "expand: %{Acct-Input-Gigawords} ->" always get nothing!

2011-09-27 Thread snan4love
ing up request 27 ID 96 with timestamp +1832
Cleaning up request 28 ID 97 with timestamp +1832
Cleaning up request 29 ID 98 with timestamp +1832
Cleaning up request 30 ID 99 with timestamp +1832
Ready to process requests.
rad_recv: Accounting-Request packet from host 192.168.0.143 port 3073,
id=101, length=168
Acct-Session-Id = "386D4387-0008"
Acct-Status-Type = Stop
Acct-Authentic = RADIUS
User-Name = "snan4love"
NAS-IP-Address = 192.168.0.143
NAS-Identifier = "AP"
NAS-Port = 0
Called-Station-Id = "00-80-48-6E-1A-87:143"
Calling-Station-Id = "00-1E-65-50-D4-EA"
NAS-Port-Type = Wireless-802.11
Connect-Info = "CONNECT 11Mbps 802.11b"
Acct-Session-Time = 2976
Event-Timestamp = "Jan  1 2000 13:13:25 CST"
Acct-Terminate-Cause = User-Request
# Executing section preacct from file /etc/raddb/sites-enabled/default
+- entering group preacct {...}
++[preprocess] returns ok
[acct_unique] Hashing 'NAS-Port = 0,Client-IP-Address =
192.168.0.143,NAS-IP-Address = 192.168.0.143,Acct-Session-Id =
"386D4387-0008",User-Name = "snan4love"'
[acct_unique] Acct-Unique-Session-ID = "f6139abfb9132394".
++[acct_unique] returns ok
[suffix] No '@' in User-Name = "snan4love", looking up realm NULL
[suffix] No such realm "NULL"
++[suffix] returns noop
++[files] returns noop
# Executing section accounting from file /etc/raddb/sites-enabled/default
+- entering group accounting {...}
[detail]expand: %{Packet-Src-IP-Address} -> 192.168.0.143
[detail]expand:
/var/log/radius/radacct/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}/detail-%Y%m%d
-> /var/log/radius/radacct/192.168.0.143/detail-20110927
[detail]
/var/log/radius/radacct/%{%{Packet-Src-IP-Address}:-%{Packet-Src-IPv6-Address}}/detail-%Y%m%d
expands to /var/log/radius/radacct/192.168.0.143/detail-20110927
[detail]expand: %t -> Tue Sep 27 16:43:24 2011
++[detail] returns ok
[radutmp]   expand: /var/log/radius/radutmp -> /var/log/radius/radutmp
[radutmp]   expand: %{User-Name} -> snan4love
++[radutmp] returns ok
[sql]   expand: %{User-Name} -> snan4love
[sql] sql_set_user escaped user --> 'snan4love'
[sql]   expand: %{Acct-Input-Gigawords} -> 
[sql]   ... expanding second conditional
[sql]   expand: %{Acct-Input-Octets} -> 
[sql]   ... expanding second conditional
[sql]   expand: %{Acct-Output-Gigawords} -> 
[sql]   ... expanding second conditional
[sql]   expand: %{Acct-Output-Octets} -> 
[sql]   ... expanding second conditional
[sql]   expand: %{Acct-Delay-Time} -> 
[sql]   ... expanding second conditional
[sql]   expand:UPDATE radacct SET  acctstoptime  
= '%S',  acctsessiontime= '%{Acct-Session-Time}', 
acctinputoctets= '%{%{Acct-Input-Gigawords}:-0}' << 32 |
  
'%{%{Acct-Input-Octets}:-0}',  acctoutputoctets   =
'%{%{Acct-Output-Gigawords}:-0}' << 32 |  
'%{%{Acct-Output-Octets}:-0}',  acctterminatecause =
'%{Acct-Terminate-Cause}',  acctstopdelay  =
'%{%{Acct-Delay-Time}:-0}',  connectinfo_stop   =
'%{Connect-Info}'   WHERE acctsessionid   = '%{Acct-Session-Id}'
  
AND username  = '%{SQL-User-Name}'   AND nasipaddress  =
'%{NAS-IP-Address}' ->UPDATE radacct SET 
acctstoptime   = '2011-09-27 16:43:24',  acctsessiontime   
= '2976',      acctinputoctets    = '0' << 32 | 
 
'0',  acctoutputoctets   = '0' << 32 |   
rlm_sql (sql): Reserving sql socket id: 2
rlm_sql (sql): Released sql socket id: 2
++[sql] returns ok
++[exec] returns noop
[attr_filter.accounting_response]   expand: %{User-Name} -> snan4love
 attr_filter: Matched entry DEFAULT at line 12
++[attr_filter.accounting_response] returns updated
Sending Accounting-Response of id 101 to 192.168.0.143 port 3073
Finished request 32.
Cleaning up request 32 ID 101 with timestamp +4808
Going to the next request
Ready to process requests.


--
View this message in context: 
http://freeradius.1045715.n5.nabble.com/Problem-expand-Acct-Input-Gigawords-always-get-nothing-tp4844371p4844535.html
Sent from the FreeRadius - User mailing list archive at Nabble.com.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html


Re: Problem "expand: %{Acct-Input-Gigawords} ->" always get nothing!

2011-09-27 Thread Arran Cudbard-Bell
Also... Whilst it is a very pretty signature Mr Chapellon I direct you to the 
rules of the FreeRADIUS users list...

http://freeradius.org/list/users.html

The Second rule of the FreeRADIUS users list - 'No HTML on the list'
The Third rule of the FreeRADIUS users list - 'No vcards'

-Arran

Arran Cudbard-Bell
a.cudba...@freeradius.org

Betelwiki, Betelwiki, Betelwiki http://wiki.freeradius.org/ !

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


Re: Problem "expand: %{Acct-Input-Gigawords} ->" always get nothing!

2011-09-27 Thread Arran Cudbard-Bell

On 27 Sep 2011, at 09:52, snan4love wrote:

> Hello Everybody:
> Thanks for opening this topic.

We didn't open it you did. :)

> Right now,I have set up the FreeRadius+Mysql+Wifi system, I could get into
> the internet via this system on my laptop.
> But my problem is :
> No matter how long i stay in the connection, the AcctInputOctets and
> AcctOutPutOctets are always 0;
> the debug information from radiusd -X mode regarding this issue is :


Please include the entire debug log, with the bits that show the incoming 
packets... Then we can tell if you've mangled the config, or if the NAS is just 
broken.

-Arran

Arran Cudbard-Bell
a.cudba...@freeradius.org

Betelwiki, Betelwiki, Betelwiki http://wiki.freeradius.org/ !


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


Re: Problem "expand: %{Acct-Input-Gigawords} ->" always get nothing!

2011-09-27 Thread Alexandre Chapellon

  
  


Le 27/09/2011 09:52, snan4love a écrit :

  Hello Everybody:
Thanks for opening this topic.
Right now,I have set up the FreeRadius+Mysql+Wifi system, I could get into
the internet via this system on my laptop.
But my problem is :
No matter how long i stay in the connection, the AcctInputOctets and
AcctOutPutOctets are always 0;
the debug information from radiusd -X mode regarding this issue is :

[sql] 	expand: %{User-Name} -> snan4love
[sql] sql_set_user escaped user --> 'snan4love'
[sql] 	expand: %{Acct-Input-Gigawords} -> 
[sql] 	... expanding second conditional
[sql] 	expand: %{Acct-Input-Octets} -> 
[sql] 	... expanding second conditional
[sql] 	expand: %{Acct-Output-Gigawords} -> 
[sql] 	... expanding second conditional
[sql] 	expand: %{Acct-Output-Octets} -> 
[sql] 	... expanding second conditional
[sql] 	expand: %{Acct-Delay-Time} -> 
[sql] 	... expanding second conditional
[sql] 	expand:UPDATE radacct SET  acctstoptime  
= '%S',  acctsessiontime= '%{Acct-Session-Time}', 
acctinputoctets= '%{%{Acct-Input-Gigawords}:-0}' << 32 |  
'%{%{Acct-Input-Octets}:-0}',  acctoutputoctets   =
'%{%{Acct-Output-Gigawords}:-0}' << 32 |  
'%{%{Acct-Output-Octets}:-0}',  acctterminatecause =
'%{Acct-Terminate-Cause}',  acctstopdelay  =
'%{%{Acct-Delay-Time}:-0}',  connectinfo_stop   =
'%{Connect-Info}'   WHERE acctsessionid   = '%{Acct-Session-Id}'  
AND username  = '%{SQL-User-Name}'   AND nasipaddress  =
'%{NAS-IP-Address}' ->UPDATE radacct SET 
acctstoptime   = '2011-09-27 15:45:35',  acctsessiontime   
= '1317',  acctinputoctets= '0' << 32 |  
'0',  acctoutputoctets   = '0' << 32 |   

Every expand:%{Acct-Input-...} will get nothing.
I know,there must be misconfiguration I made, but I dont know where to fix
it.
Please help me, 
Thank you very much.

    
    Well, I guess you don't have those attributes in the accouting
packets sent by your NAS... Have you checked this?


  
--
View this message in context: http://freeradius.1045715.n5.nabble.com/Problem-expand-Acct-Input-Gigawords-always-get-nothing-tp4844371p4844371.html
Sent from the FreeRadius - User mailing list archive at Nabble.com.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html



-- 
  
  
Alexandre Chapellon
Ingénierie des systèmes open sources et
  réseaux.
  Follow me on twitter: @alxgomz
  

  

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


Re: Problem "expand: %{Acct-Input-Gigawords} ->" always get nothing!

2011-09-27 Thread Alan DeKok
snan4love wrote:
> But my problem is :
> No matter how long i stay in the connection, the AcctInputOctets and
> AcctOutPutOctets are always 0;

  Blame the NAS.

> the debug information from radiusd -X mode regarding this issue is :

  Deleting the majority of the debug output is a bad idea.  If you don't
know *why* it doesn't work, you don't know *which part* of the debug
output is important.

  So don't edit things you don't understand.

> Every expand:%{Acct-Input-...} will get nothing.
> I know,there must be misconfiguration I made, but I dont know where to fix
> it.

  READ the debug output, and think about it.  Odds are that the NAS is
*not* sending Acct-Input-Octets.  This information will be in the debug
output.  If that happens, THINK.  What should happen when you try to
expand something that doesn't exist?

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


Problem "expand: %{Acct-Input-Gigawords} ->" always get nothing!

2011-09-27 Thread snan4love
Hello Everybody:
Thanks for opening this topic.
Right now,I have set up the FreeRadius+Mysql+Wifi system, I could get into
the internet via this system on my laptop.
But my problem is :
No matter how long i stay in the connection, the AcctInputOctets and
AcctOutPutOctets are always 0;
the debug information from radiusd -X mode regarding this issue is :

[sql]   expand: %{User-Name} -> snan4love
[sql] sql_set_user escaped user --> 'snan4love'
[sql]   expand: %{Acct-Input-Gigawords} -> 
[sql]   ... expanding second conditional
[sql]   expand: %{Acct-Input-Octets} -> 
[sql]   ... expanding second conditional
[sql]   expand: %{Acct-Output-Gigawords} -> 
[sql]   ... expanding second conditional
[sql]   expand: %{Acct-Output-Octets} -> 
[sql]   ... expanding second conditional
[sql]   expand: %{Acct-Delay-Time} -> 
[sql]   ... expanding second conditional
[sql]   expand:UPDATE radacct SET  acctstoptime  
= '%S',  acctsessiontime= '%{Acct-Session-Time}', 
acctinputoctets= '%{%{Acct-Input-Gigawords}:-0}' << 32 |
  
'%{%{Acct-Input-Octets}:-0}',  acctoutputoctets   =
'%{%{Acct-Output-Gigawords}:-0}' << 32 |  
'%{%{Acct-Output-Octets}:-0}',  acctterminatecause =
'%{Acct-Terminate-Cause}',  acctstopdelay  =
'%{%{Acct-Delay-Time}:-0}',  connectinfo_stop   =
'%{Connect-Info}'   WHERE acctsessionid   = '%{Acct-Session-Id}'
  
AND username  = '%{SQL-User-Name}'   AND nasipaddress  =
'%{NAS-IP-Address}' ->UPDATE radacct SET 
acctstoptime   = '2011-09-27 15:45:35',  acctsessiontime   
= '1317',  acctinputoctets= '0' << 32 | 
 
'0',  acctoutputoctets   = '0' << 32 |   

Every expand:%{Acct-Input-...} will get nothing.
I know,there must be misconfiguration I made, but I dont know where to fix
it.
Please help me, 
Thank you very much.

--
View this message in context: 
http://freeradius.1045715.n5.nabble.com/Problem-expand-Acct-Input-Gigawords-always-get-nothing-tp4844371p4844371.html
Sent from the FreeRadius - User mailing list archive at Nabble.com.
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html