Hi Arnie,
On Jul 14, 4:58pm, Arnie Roberts wrote:
> Subject: (RADIATOR) accounting session start times
> Hi all,
>
> I would like to add accounting entries to a simple database.
> To keep things simple I would prefer to only log Stop requests
> and not Start requests, thereby giving me one record per session.
>
> Is there a way in which I can log the start time of the session?
> I was thinking of something like
>
> AcctColumnDef StartTime,Timestamp - Acct-Session-Time
That wont work Im afraid.
There are 2 ways you can deal with this:
1. Add a PreAuthHook that will calculte and add a new pseudo-attribute from
Timestamp and AcctSessionTime. In your AcctColumnDef, specify that new
pseudo-attribute.
2. Use AcctSQLStatement to specify the entire SQL statement you wish to
execute, something like this:
AcccountingStopsOnly
AcctSQLStatement insert into ACCOUNTING (..., StartTime, ....) values\
(..., %{Timestamp} - %{Acct-Session-Time}, .....)
However, we are somewhat of the view that you are better off saving the
original data in your SQL database, rather than computing a new data point (and
denormalising your database somewhat). You can always do the calulation when
viewing the data.
Hope that helps.
Cheers.
>
> thanks
>
> Arnie
>
>
> ===
> Archive at http://www.thesite.com.au/~radiator/
> To unsubscribe, email '[EMAIL PROTECTED]' with
> 'unsubscribe radiator' in the body of the message.
>-- End of excerpt from Arnie Roberts
--
Mike McCauley [EMAIL PROTECTED]
Open System Consultants Pty. Ltd Unix, Perl, Motif, C++, WWW
24 Bateman St Hampton, VIC 3188 Australia http://www.open.com.au
Phone +61 3 9598-0985 Fax +61 3 9598-0955
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald,
Platypus, Freeside, TACACS+, PAM, external, etc etc on Unix, Win95/8,
NT, Rhapsody
===
Archive at http://www.thesite.com.au/~radiator/
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.