(RADIATOR) Re: %w with AcctColumnDef not working

Hugh Irvine hugh at open.com.au
Sun Aug 29 18:11:09 CDT 2004


Hello -

Try this:

	AcctColumnDef USERNAME, %w, formatted

See section 6.28.14 in the Radiator 3.9 reference manual 
("doc/ref.html").

regards

Hugh


On 30 Aug 2004, at 01:12, Mohammad Junaid wrote:

> We are storing complete usernames with realm in the subscribers table 
> as username but in the accounting table we need only first part of the 
> username and not the realms. I tried the following
>   
> AcctColumnDef   USERNAME, '%w' but it is not working, it only works as 
> AcctColumnDef   USERNAME, User-Name. Below is my cfg file, any idea?
>  
> ================ radius.cfg ================
> Foreground
> LogStdout
> LogDir /radius/log     
> LogFile %L/logfile-%Y-%m-%d
> DbDir           .
> DictionaryFile /etc/radiator/dictionary
> Trace   4
>  
> <Client DEFAULT>
>         Secret xxxx    
>         DupInterval 0
> </Client>
>  
>
>
> <Realm DEFAULT>
>     <AuthBy SQL>
>  
>         DBSource        dbi:Oracle:imsmaster
>         DBUsername      xxx
>         DBAuth          xxx
>  
>         DefaultSimultaneousUse 1
>  
>
> HandleAcctStatusTypes Stop
>  
> AuthSelect select password, checkattr, replyattr from subscribers \
>         where username=%0 \
>         and status = 1
>          AuthColumnDef 0, User-Password, check
>         AuthColumnDef 1, GENERIC, check
>         AuthColumnDef 2, GENERIC, reply
>  
>
>         AccountingTable ACCOUNTING
>         AcctColumnDef   USERNAME,User-Name
>         AcctColumnDef   TIME_STAMP,Timestamp,formatted-date,to_date\
>         ('%d %m         %Y %H:%M:%S', 'DD MM YYYY HH24:MI:SS')
>         AcctColumnDef   
> START_TIME_UNIXFMT,%b-0%{Acct-Session-Time},literal
>         AcctColumnDef   ACCTSTATUSTYPE,Acct-Status-Type
>         AcctColumnDef   ACCTDELAYTIME,Acct-Delay-Time,integer
>         AcctColumnDef   ACCTINPUTOCTETS,Acct-Input-Octets,integer
>         AcctColumnDef   ACCTOUTPUTOCTETS,Acct-Output-Octets,integer
>         AcctColumnDef   ACCTSESSIONID,Acct-Session-Id
>         AcctColumnDef   ACCTSESSIONTIME,Acct-Session-Time,integer
>         AcctColumnDef   ACCTTERMINATECAUSE,Acct-Terminate-Cause
>         AcctColumnDef   NAS_IP_ADDR,NAS-IP-Address
>         AcctColumnDef   NASPORT,NAS-Port,integer
>         AcctColumnDef   FRAMEDIPADDRESS,Framed-IP-Address
>         AcctColumnDef   T_C_ENDPOINT,Tunnel-Client-Endpoint
>         AcctColumnDef   T_S_AUTHID,Tunnel-Server-Auth-ID
>         AcctColumnDef   CALLERID,Calling-Station-Id
>  
>  
>  
>         SQLRecoveryFile %D/missedaccounting
>     </AuthBy>
>  
>
>         <AuthLog SQL>
>                 DBSource        dbi:Oracle:imsmaster
>                 DBUsername      xxx 
>                 DBAuth          xxx
>  
>                 LogFailure
>                 FailureQuery insert into RADAUTHLOG (TIME_STAMP, 
> USERNAME, TYPE, REASON) values (to_date('%d %m         %Y %H:%M:%S'
> , 'DD MM YYYY HH24:MI:SS'), '%w', 0, %1)
>         </AuthLog>
>  
>         <SessionDatabase SQL>
>                 DBSource        dbi:Oracle:imsmaster
>                 DBUsername      xxx
>                 DBAuth          xxx
>  
>             AddQuery    insert into RADONLINE 
> (USERNAME,NASIDENTIFIER,NASPORT,\
>                         
> ACCTSESSIONID,TIME_STAMP,FRAMEDIPADDRESS,NASPORTTYPE,\
>                         SERVICETYPE,CALLERID,CALLEDSTATIONID) values \
>  
>                         
> (%0,'%{NAS-IP-Address}',%{NAS-Port},'%{Acct-Session-Id}',\
>                         to_date('%d %m         %Y %H:%M:%S', 'DD MM 
> YYYY HH24:MI:SS'),'%{Framed-IP-Address}','%{NAS-Port-Type}',\
>                         
> '%{Framed-Protocol}','%{Calling-Station-Id}','%{Called-Station-Id}')
>  
>             DeleteQuery delete from RADONLINE where USERNAME=%0 and \
>                         NASIDENTIFIER='%N' and NASPORT=%{NAS-Port}
>  
>             ClearNasQuery delete from RADONLINE where 
> NASIDENTIFIER='%N'
>                         CountQuery  select NASIDENTIFIER, NASPORT, 
> ACCTSESSIONID from \
>                         RADONLINE where USERNAME=%0
>         </SessionDatabase>
> </Realm>
>

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