[RADIATOR] Local Variable

Hugh Irvine hugh at open.com.au
Tue Jul 7 00:53:18 CDT 2009


Hello Andrea -

Why don't you just use a simple AcctLogFileName and AcctLogFileFormat?

See sections 15.7.14 and 15.4.15 in the Radiator 4.4 reference manual  
("doc/ref.pdf").

regards

Hugh



On 7 Jul 2009, at 04:34, Andrea Coppini (AIR Networks) wrote:

> Hi,
>
> I'm trying to do a seemingly simple thing in the config file.
>
> I have a setup which relies heavily on CSV files.  Without going  
> into the
> merits of doing this, I need to generate a CSV file with the current  
> time
> down to the millisecond, then I need to write the accounting record  
> to it.
> Something like this...
>
> <Handler Request-Type=Accounting-Request>
>    <AuthBy SQL>
>    	HandleAcctStatusTypes Stop
> 	DBSource dbi:CSV:f_dir=C:\hotspot-gateway;
>
> 	AcctSQLStatement CREATE TABLE %Y%m%d-%H%M%S-%s (rmnum INTEGER,
> time_session CHAR(64), time_in CHAR(64), time_out CHAR(64), endreason
> CHAR(64))
>
> 	AccountingTable	%Y%m%d-%H%M%S-%s
> 	AcctColumnDef	rmnum,User-Name
> 	AcctColumnDef	time_session,Acct-Session-Time,integer
> 	AcctColumnDef	time_out,Timestamp,integer-date
> 	AcctColumnDef	endreason,Acct-Terminate-Cause
>    </AuthBy>
> </Handler>
>
>
> With this, the file gets generated correctly, but since there is a  
> very
> slight lag between the creation of the file and RADIATOR opening it to
> process it, the millisecond variable would have changed by the time  
> it gets
> to the AccountingTable line.
>
> So I was wondering if it would be possible to define a local  
> variable (eg.
> $thisfile) with the current time assigned to it, then have a
> "AcctSQLStatement CREATE TABLE $thisfile....etc" and "AccountingTable
> $thisfile" on the following line.
>
> But I can't find a way to define a variable... can I? how?
>
> I'm a bit green on this.. so please bear with me!
>
>
> Thanks & Regards
> Andrea Coppini
> AIR Networks Co. Ltd.
> Malta
>
> _______________________________________________
> radiator mailing list
> radiator at open.com.au
> http://www.open.com.au/mailman/listinfo/radiator



NB:

Have you read the reference manual ("doc/ref.html")?
Have you searched the mailing list archive (www.open.com.au/archives/radiator)?
Have you had a quick look on Google (www.google.com)?
Have you included a copy of your configuration file (no secrets),
together with a trace 4 debug showing what is happening?
Have you checked the RadiusExpert wiki:
http://www.open.com.au/wiki/index.php/Main_Page

-- 
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. Available on *NIX, *BSD, Windows, MacOS X.
Includes support for reliable RADIUS transport (RadSec),
and DIAMETER translation agent.
-
Nets: internetwork inventory and management - graphical, extensible,
flexible with hardware, software, platform and database independence.
-
CATool: Private Certificate Authority for Unix and Unix-like systems.




More information about the radiator mailing list