Add an attribute to filter accounting data?

Alan DeKok aland at deployingradius.com
Wed Dec 16 17:40:37 CET 2020


On Dec 16, 2020, at 11:20 AM, Stefan Möding <s.moeding at gmail.com> 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.




More information about the Freeradius-Users mailing list