(RADIATOR) mysql + Timestamp problems

Hugh Irvine hugh at open.com.au
Sun Jan 15 22:57:38 CST 2006


Hello David -

I would have expected you to use an AcctColumnDef like this:

	AcctColumnDef TIME_STAMP, Timestamp, integer

How do you have the TIME_STAMP column defined in your database?

regards

Hugh


On 16 Jan 2006, at 15:14, David Sexton wrote:

> Hi There,
>
>
>
> Have problem with radiator importing the wrong date into the Mysql  
> database. I also import a log time which is fine but not as a  
> timestamp.
>
> Any ideas would be great.
>
>
>
> mysql> SELECT FROM_UNIXTIME(TIME_STAMP) FROM ACCOUNTING;
>
>
>
>
>
> | 1955-07-27 19:57:42       |
>
> | 1955-07-25 16:05:38       |
>
> | 1955-07-25 18:04:31       |
>
> | 1955-07-25 18:31:01       |
>
> | 1955-07-02 17:21:04       |
>
> | 1955-07-02 19:33:03       |
>
> | 1955-07-02 19:59:02       |
>
> | 1955-07-25 23:41:09       |
>
> | 1955-07-26 00:22:33       |
>
> | 1955-07-26 07:17:11       |
>
> | 1955-07-26 12:45:35       |
>
> | 1955-07-26 13:17:32       |
>
> | 1955-07-26 13:59:04       |
>
>
>
> [xxx at xxx]# date
>
> Mon Jan 16 16:08:16 FJT 2006
>
>
>
> # radius.cfg
>
> #
>
> # Example Radiator configuration file.
>
> # This very simple file will allow you to get started with
>
> # a simple system. You can then add and change features.
>
> # We suggest you start simple, prove to yourself that it
>
> # works and then develop a more complicated configuration as required.
>
> #
>
> # This example will authenticate from a standard users file in
>
> # DbDir/users and log accounting to LogDir/detail.
>
> #
>
> # It will accept requests from any client and try to handle request
>
> # for any realm.
>
> #
>
> # You should consider this file to be a starting point only
>
> # $Id: linux-radius.cfg,v 1.3 2002/03/24 23:07:49 mikem Exp $
>
>
>
> #Foreground
>
> #LogStdout
>
> LogDir          /var/log/radius
>
> LogFile         %L/logfile.%y-%m-%d
>
>
>
>
>
> AuthPort        1645
>
> AcctPort        1646
>
>
>
> Trace           5
>
> DbDir           /etc/radiator
>
> DictionaryFile  %D/dictionary , %D/dictionary.cisco
>
>
>
>
>
>
>
>
>
> # You will probably want to add other Clients to suit your site,
>
> # one for each NAS you want to work with
>
> <Client DEFAULT>
>
>         Secret xxxxxxxxxx
>
>         DupInterval 0
>
> </Client>
>
>
>
> <Client 202.137.178.1>
>
>          Secret xxxxxxxxxx
>
>          NasType cisco
>
>          DupInterval 1
>
> </Client>
>
>
>
> <SessionDatabase SQL>
>
>                 DBSource        dbi:mysql:radius
>
>                 DBUsername      mysql_access
>
>                 DBAuth          xxxx
>
>                 AddQuery        insert into RADONLINE (USERNAME,\
>
>                                 NASIDENTIFIER, \
>
>                                 NASPORT, \
>
>                                 ACCTSESSIONID,\
>
>                                 TIME_STAMP,\
>
>                                 FRAMEDIPADDRESS, \
>
>                                 NASPORTTYPE, \
>
>                                 SERVICETYPE, \
>
>                                 DNIS) \
>
>                 values ('%n', '%N',\
>
>                         %{NAS-Port},\
>
>                          '%{Acct-Session-Id}',\
>
>                           %{Timestamp},\
>
>                          '%{Framed-IP-Address}',\
>
>                          '%{NAS-Port-Type}', \
>
>                          '%{Service-Type}', \
>
>                          '%{Called-Station-Id}')
>
> </SessionDatabase>
>
>
>
> <Realm DEFAULT>
>
>  <AuthBy SQL>
>
>          DBSource        dbi:mysql:radius
>
>          DBUsername      mysql_access
>
>          DBAuth         xxxxx
>
>
>
>         AuthSelect      select passwd, ipaddress, idlelimit, \
>
>                         netmask, sessionlimit, portlimit,  
> ratelimitup, \
>
>                         ratelimitdown from USERS where username = '% 
> n' and status = 'OPEN'
>
>
>
>                  AuthColumnDef   0,User-Password,check
>
>                  AuthColumnDef   1,Framed-IP-Address,reply
>
>                  AuthColumnDef   2,Idle-Timeout,reply
>
>                  AuthColumnDef   3,Framed-IP-Netmask,reply
>
>                  AuthColumnDef   4,Session-Timeout,reply
>
>                  AuthColumnDef   5,Port-Limit,reply
>
>                  AuthColumnDef   6,Rate-Limit-Up,request
>
>                  AuthColumnDef   7,Rate-Limit-Down,request
>
>
>
>
>
>         AddToReply     cisco-avpair = ip:dns-servers=xxxxxxxxx  
> xxxxxxx,\
>
>                        cisco-avpair = lcp:interface-config=rate- 
> limit output %{Rate-Limit-Up} %{Rate-Limit-Up} %{Rate-Limit-Up}  
> conform-action transmit exceed-action transmit,\
>
>                        cisco-avpair = lcp:interface-config=rate- 
> limit input %{Rate-Limit-Down} %{Rate-Limit-Down} %{Rate-Limit- 
> Down} conform-action transmit exceed-action transmit
>
>
>
>
>
> AccountingStopsOnly
>
> AccountingTable ACCOUNTING
>
>                AcctColumnDef   USERNAME,User-Name
>
>                AcctColumnDef   TIME_STAMP,Timestamp,integer-date
>
>                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
>
>                AcctColumnDef   ACCTTERMINATECAUSE,Ascend-Disconnect- 
> Cause,integer
>
>                AcctColumnDef   NASIDENTIFIER,NAS-IP-Address
>
>                AcctColumnDef   NASPORT,NAS-Port,integer
>
>                AcctColumnDef   FRAMEDADDRESS,Framed-IP-Address
>
>                AcctColumnDef   CALLERID,Calling-Station-Id
>
>                AcctColumnDef   DATARATE,Ascend-Data-Rate,integer
>
>                AcctColumnDef   XMITRATE,Ascend-Xmit-Rate,integer
>
>                AcctColumnDef   CLIENTDNIS,Called-Station-Id
>
>                AcctColumnDef   LOGDATE,Timestamp
>
> </AuthBy>
>
>        AcctLogFileName %L/detail
>
>        PasswordLogFileName %L/password-%y-%m-%d.log
>
>
>
> </Realm>
>
>


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?

-- 
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