Add an attribute to filter accounting data?

classic Classic list List threaded Threaded
2 messages Options
| Threaded
Open this post in threaded view
|

Add an attribute to filter accounting data?

Stefan Möding
Hi!

We are using multiple Radius accounts to monitor the Freeradius server: is
it answering at all, avg. time to process an auth request, avg. time to
process an acct request, ...

These users would generate a great deal of data in the accounting logs (we
use the SQL driver to put it in a database).  Currently I have something
like this in the accounting configuration to filter for one user:

if (&User-Name != "radmonitoring") {
  sql_acct
}

I was wondering if it would be easier to add an additional attribute to
the user so I could use that attribute as the filter condition.
Advantage: it could work for multiple users without touching the config.

Has anybody done something like this?
What attribute would be a good pick?

Thanks!
--
Stefan
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
| Threaded
Open this post in threaded view
|

Re: Add an attribute to filter accounting data?

Alan DeKok-2
On Dec 16, 2020, at 11:20 AM, Stefan Möding <[hidden email]> wrote:
> We are using multiple Radius accounts to monitor the Freeradius server: is
> it answering at all, avg. time to process an auth request, avg. time to
> process an acct request, ...

  That's good.

> These users would generate a great deal of data in the accounting logs (we
> use the SQL driver to put it in a database).  Currently I have something
> like this in the accounting configuration to filter for one user:
>
> if (&User-Name != "radmonitoring") {
>  sql_acct
> }
>
> I was wondering if it would be easier to add an additional attribute to
> the user so I could use that attribute as the filter condition.
> Advantage: it could work for multiple users without touching the config.

  Yes.

> Has anybody done something like this?
> What attribute would be a good pick?

  Just use an attribute that you don't normally see in the RADIUS packets.  Something like Framed-AppleTalk-Zone should be good.  I don't think anyone will be using AppleTalk for anything.  :)

  It's a string value, so you can set the value in the client to something useful.  This lets you know what the check is for.

Framed-AppleTalk-Zone = "checking for FOO"

  Then, just check for the existence of the attribute:

        if (&Framed-AppleTalk-Zone) {
                return
        }
        sql_acct

  Alan DeKok.


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