Hi, we have a radius server installed collecting accounting data from a Cellular network. Currently we receive the Interim update every 30 minutes, and it updates the radacct table correctly . What we need is to be able to know what was the delta of acctinputoctets and acctoutputoctets that was received in this event , in comparison to the data that was already in the DB from the previous notifications. Can I somehow enter this delta into a different table that will show me the usage for each notification? Thanks Liran
On Jun 26, 2016, at 7:14 AM, liran kessel <lirankessel@gmail.com> wrote:
What we need is to be able to know what was the delta of acctinputoctets and acctoutputoctets that was received in this event , in comparison to the data that was already in the DB from the previous notifications. Can I somehow enter this delta into a different table that will show me the usage for each notification?
You need to calculate the delta first. Write a SELECT statement which grabs the current value from the DB, and then subtract it from the current value of the attribute. Put the result into the SQL table. Alan DeKok.
would you recommend doing it within the dialup.conf configuration? how would i configure it to do 3 steps: Select Update radacct insert new table? Thanks
On 26 Jun 2016, at 2:26 PM, Alan DeKok <aland@deployingradius.com> wrote:
On Jun 26, 2016, at 7:14 AM, liran kessel <lirankessel@gmail.com> wrote:
What we need is to be able to know what was the delta of acctinputoctets and acctoutputoctets that was received in this event , in comparison to the data that was already in the DB from the previous notifications. Can I somehow enter this delta into a different table that will show me the usage for each notification?
You need to calculate the delta first. Write a SELECT statement which grabs the current value from the DB, and then subtract it from the current value of the attribute. Put the result into the SQL table.
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On Jun 26, 2016, at 7:30 AM, liran kessel <lirankessel@gmail.com> wrote:
would you recommend doing it within the dialup.conf configuration?
The default schema just inserts into the table
how would i configure it to do 3 steps: Select Update radacct insert new table?
a) read "man unlang" to see how to create policies in FreeRADIUS b) read your database documentation to see how to use select / update queries in your DB. Do you want to understand what you're doing, or do you want someone else to spoon-feed you a bunch of magic that might or might not work? Alan DeKok.
Hi Alan, Thanks for your help, it is very much appreciated, and I am sure I like many others ask questions which feel “dumb” and I apologise. I am not trying to be spoon-fed everything , and i understand and know how to do things in the DB. from my understanding freeradius doesn’t just insert, it inserts, or updates depending on if its a new session or an existing one, and thats why I asked if there was a way to do it before insert rather than within the DB. I will try your recommendation and see if I can do it with unlang, or need to add another inserted table and then select the difference. Thanks for your help. Liran
On 26 Jun 2016, at 2:34 PM, Alan DeKok <aland@deployingradius.com> wrote:
On Jun 26, 2016, at 7:30 AM, liran kessel <lirankessel@gmail.com> wrote:
would you recommend doing it within the dialup.conf configuration?
The default schema just inserts into the table
how would i configure it to do 3 steps: Select Update radacct insert new table?
a) read "man unlang" to see how to create policies in FreeRADIUS
b) read your database documentation to see how to use select / update queries in your DB.
Do you want to understand what you're doing, or do you want someone else to spoon-feed you a bunch of magic that might or might not work?
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On Jun 26, 2016, at 7:42 AM, liran kessel <lirankessel@gmail.com> wrote:
Thanks for your help, it is very much appreciated, and I am sure I like many others ask questions which feel “dumb” and I apologise. I am not trying to be spoon-fed everything , and i understand and know how to do things in the DB.
That's good.
from my understanding freeradius doesn’t just insert, it inserts, or updates depending on if its a new session or an existing one, and thats why I asked if there was a way to do it before insert rather than within the DB.
And does any of that subtract one number from another? Did you *read* the SQL queries for those inserts / updates to see what they did? This is one of my biggest frustrations on the list. I would prefer for people to read the existing docs and/or configuration files. Instead, many people ask questions which are answered there. Well... *read* the config files to see what the inserts / updates do. If you know SQL, it should take you 5 minutes to see that they *don't* do subtraction. Doing so is faster than asking a question on the list. And, you get to learn more about how the server works, which is good. Asking simple questions just comes across as you want me to do work, and that you're not willing to do it. That's a large part of why many of my responses here are "think for yourself, and read the docs / config files". Alan DeKok.
In continuation to your recommendations I have tried to set up another dialup.conf file that inserts data into a different table in addition to the regular dialup.conf that updates the radacct table. however I have 2 problems. 1. when I run it I get an error regarding my sql command but running radiusd -X doesn’t display the full query, it gets cut in the middle. is there any way to make it show the whole output? 2. Is it possible instead of the way I did it, to rather get both commands into the same dialup.conf file? I saw on the forum that 1 person did this with a stored procedure instead. Thanks. Liran
On 27 Jun 2016, at 4:18 PM, Alan DeKok <aland@deployingradius.com> wrote:
On Jun 26, 2016, at 7:42 AM, liran kessel <lirankessel@gmail.com> wrote:
Thanks for your help, it is very much appreciated, and I am sure I like many others ask questions which feel “dumb” and I apologise. I am not trying to be spoon-fed everything , and i understand and know how to do things in the DB.
That's good.
from my understanding freeradius doesn’t just insert, it inserts, or updates depending on if its a new session or an existing one, and thats why I asked if there was a way to do it before insert rather than within the DB.
And does any of that subtract one number from another? Did you *read* the SQL queries for those inserts / updates to see what they did?
This is one of my biggest frustrations on the list. I would prefer for people to read the existing docs and/or configuration files. Instead, many people ask questions which are answered there.
Well... *read* the config files to see what the inserts / updates do. If you know SQL, it should take you 5 minutes to see that they *don't* do subtraction. Doing so is faster than asking a question on the list. And, you get to learn more about how the server works, which is good.
Asking simple questions just comes across as you want me to do work, and that you're not willing to do it. That's a large part of why many of my responses here are "think for yourself, and read the docs / config files".
Alan DeKok.
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On Jul 5, 2016, at 11:07 AM, liran kessel <lirankessel@gmail.com> wrote:
In continuation to your recommendations I have tried to set up another dialup.conf file that inserts data into a different table in addition to the regular dialup.conf that updates the radacct table. however I have 2 problems. 1. when I run it I get an error regarding my sql command but running radiusd -X doesn’t display the full query, it gets cut in the middle. is there any way to make it show the whole output?
No. The limit for that is hard-coded.
2. Is it possible instead of the way I did it, to rather get both commands into the same dialup.conf file? I saw on the forum that 1 person did this with a stored procedure instead.
Use a stored procedure, or do the math in the SQL query. Alan DeKok.
participants (2)
-
Alan DeKok -
liran kessel