How to get accounting data from freeRadius server using freeradius client
Hi, Is it possible to get the accounting data from the radius server using radius client in NAS and how? I am using freeradius server 2.X for collecting all the billing data (in radacct log files) of VOIP calls. Then generate bills using our software. But sometime the accounting data required in NAS (VOIP server) also, how can i get this data on NAS from radius server? Thanks, Rahul Panwar
Rahul Panwar wrote:
Is it possible to get the accounting data from the radius server using radius client in NAS and how?
No. Use a database query language.
I am using freeradius server 2.X for collecting all the billing data (in radacct log files) of VOIP calls. Then generate bills using our software. But sometime the accounting data required in NAS (VOIP server) also, how can i get this data on NAS from radius server?
Have the NAS use RADIUS to send the accounting data to the server. Alan DeKok.
Thanks for replying Alan,
Is it possible to get the accounting data from the radius server using radius client in NAS and how?
No. Use a database query language.
I am not using any database server (MySQL etc.) on Radius server, i am just using the radacct log file. How can i send the query to radius server?
Have the NAS use RADIUS to send the accounting data to the server.
Yes the NAS sends the Accounting start request at the time of call start & Accounting stop request at call stop. Radacct log is used by billing software to generate the bills. Rahul Panwar
Rahul Panwar wrote:
Thanks for replying Alan,
Is it possible to get the accounting data from the radius server using radius client in NAS and how?
No. Use a database query language.
I am not using any database server (MySQL etc.) on Radius server, i am just using the radacct log file. How can i send the query to radius server?
You can't. FreeRadius has no such facility. Use a database server, or write a script process the radacct file. You can put accounting into both the radacct & database if you want.
Thanks for a quick response,
You can't. FreeRadius has no such facility.
Use a database server, or write a script process the radacct file. You can put accounting into both the radacct & database if you want.
What is the use of Acct-Interim-Interval? Is it not possible to get the update using this? Is it the received from radius server as a Authentication/Accounting response? or NAS has to send it as a request? I am actually confused with it. On Sat, Jan 16, 2010 at 7:47 PM, Phil Mayers <p.mayers@imperial.ac.uk>wrote:
Rahul Panwar wrote:
Thanks for replying Alan,
Is it possible to get the accounting data from the radius server using radius client in NAS and how?
No. Use a database query language.
I am not using any database server (MySQL etc.) on Radius server, i am just using the radacct log file. How can i send the query to radius server?
You can't. FreeRadius has no such facility.
Use a database server, or write a script process the radacct file. You can put accounting into both the radacct & database if you want.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Rahul Panwar wrote:
Thanks for a quick response,
You can't. FreeRadius has no such facility.
Use a database server, or write a script process the radacct file. You can put accounting into both the radacct & database if you want.
What is the use of Acct-Interim-Interval? Is it not possible to get the update using this? Is it the received from radius server as a Authentication/Accounting response? or NAS has to send it as a request?
Acct-Interim-Interval is a value, sent from the radius server to the NAS, in the authentication response. It instructs the NAS to send interim accounting packets to the radius server, at the interval given. For example: NAS: access-reqest Srv: access-accept Acct-Interim-Interval = 300 (5 minutes) NAS: Accounting-Start <300 second gap> NAS: Accoounting-Alive inbytes=10000 outbytes=10000 <300 seconds gap> NAS: Accoounting-Alive inbytes=20000 outbytes=20000 ... NAS: Accounting-Stop If the radius server doesn't give Acct-Interim-Interval, the NAS may have a default value, or may not send interim accounting at all. To repeat the answer to your original question: there is no mechanism in radius (or extension in FreeRadius) for a NAS to query a radius server for accounting. Accounting is one-way - NAS -> Radius server. You will need to use another method (query the files, or query a database) to do what you asked.
Ok thanks for your information. Now i can confidently use other method to get the accounting data from Radius server. It is good & easy for me to get whole radacct log file in NAS (using rsync) for now and use it accordingly. Can you send me a good link to integrate accounting data on Radius server to a database server like MySQL. So that i can unrestrict the use of NAS radiusclient to others radius server also. Thanks for helping. On Sat, Jan 16, 2010 at 11:05 PM, Phil Mayers <p.mayers@imperial.ac.uk>wrote:
Rahul Panwar wrote:
Thanks for a quick response,
You can't. FreeRadius has no such facility.
Use a database server, or write a script process the radacct file. You can put accounting into both the radacct & database if you want.
What is the use of Acct-Interim-Interval? Is it not possible to get the update using this? Is it the received from radius server as a Authentication/Accounting response? or NAS has to send it as a request?
Acct-Interim-Interval is a value, sent from the radius server to the NAS, in the authentication response.
It instructs the NAS to send interim accounting packets to the radius server, at the interval given. For example:
NAS: access-reqest Srv: access-accept Acct-Interim-Interval = 300 (5 minutes) NAS: Accounting-Start <300 second gap> NAS: Accoounting-Alive inbytes=10000 outbytes=10000 <300 seconds gap> NAS: Accoounting-Alive inbytes=20000 outbytes=20000
...
NAS: Accounting-Stop
If the radius server doesn't give Acct-Interim-Interval, the NAS may have a default value, or may not send interim accounting at all.
To repeat the answer to your original question: there is no mechanism in radius (or extension in FreeRadius) for a NAS to query a radius server for accounting.
Accounting is one-way - NAS -> Radius server.
You will need to use another method (query the files, or query a database) to do what you asked.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (3)
-
Alan DeKok -
Phil Mayers -
Rahul Panwar