(RADIATOR) Compute the Start time from Timestamp and Acct-Session-Time

Hugh Irvine hugh at open.com.au
Thu Jul 15 20:23:59 CDT 2004


Hello Alex -

What you show below should work.

The easiest way to see what is happening in a hook is to add "print 
...." statements and then run radiusd from the command line so you can 
see what is printed.

	perl radiusd -foreground -log_stdout -trace 4 -config_file .....

regards

Hugh


On 16 Jul 2004, at 02:03, Lopez, A. wrote:

> Hello all,
>
> I want to store in MySQL database accounting information of calls 
> (using the GNU gatekeeper).
>
> This is part of my config:
>
>  
>
> AcctColumnDef USERNAME,User-Name,
>
> AcctColumnDef CALLINGSTATIONID,Calling-Station-Id,
>
> AcctColumnDef CALLEDSTATIONID,Called-Station-Id,
>
> AcctColumnDef STOP_TIME, Timestamp, integer-date, %H:%M:%S,
>
> AcctColumnDef DURATION_sec, Acct-Session-Time
>
>  
>
> Well, everything goes fine but I also want to store the Start Time of 
> the call in the format %H:%M:%S.
>
>  I though it would be easy to compute the start time by subtracting 
> the Acct-Session-Time to the Timestamp, but I don’t find the way to do 
> it (perhaps I should take a rest!)
>
> Is it possible to do such a subtraction in the config file itself?? If 
> that’s the case, what kind of command/syntax I should use??
>
>  
>
> I also tried to compute the start time using a PreProcessingHook, 
> which computes the difference and adds an attribute “Timestamp_start”
>
>   
>
> sub {
>
>         my $p=${$_[0]};
>
>  
>
>         $p->add_attr('Timestamp_start',  $p->get_attr('Timestamp') - 
> $p->get_attr('Acct-Session-Time'));
>
> }
>
>   
>
> After that, I add this line in the Config file, in order to store the 
> Timestamp in %H:%M:%S format:
>
>  
>
> AcctColumnDef START_TIME, Timestamp_start, integer-date, %H:%M:%S,
>
>  
>
> This adds wrong information to MySQL.
>
>  
>
> Any idea??
>
> Alex
>

NB: have you included a copy of your configuration file (no secrets),
together with a trace 4 debug showing what is happening?

-- 
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. Available on *NIX, *BSD, Windows, MacOS X.
-
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.

--
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.


More information about the radiator mailing list