(RADIATOR) Radonline Insert into problem
Hugh Irvine
hugh at open.com.au
Thu Jun 14 18:48:03 CDT 2001
Hello Mohammed -
I would suggest that you simplify your configuration file and remove all the
commented lines. You should also keep the line lengths fairly short and make
sure the continuations are correct ("\").
hth
Hugh
On Thursday 14 June 2001 23:01, Mohammed Adam wrote:
> Hello
>
> I'm facing a weird problem, the radonline insert into is failing, in the
> debug the sql statement is different from the cfg file..
>
> how can this happen i'm sure its running this cfg file.
> its adding #NASPORTTYPE and in value #''
>
> can anybody help me
>
> # SH configuration
> #
> #
> #
> # You should consider this file to be a starting point only
> #
>
> Foreground
> LogStdout
> LogDir .
> DbDir .
> DictionaryFile d:\radiator\dictionary.cisco
> Trace 4
> #AuthPort 1645
> #AcctPort 1646
>
> #SnmpgetProg d:\snmpget
> # For testing: this allows us to honour requests from radpwtst
> # on the same host.
> <Client localhost>
> Secret mysecret
> DupInterval 300
> </Client>
> <Client 168.187.81.1>
> Secret #####
> DupInterval 300
> </Client>
>
> <SessionDatabase SQL>
>
>
> #Identifier OnlineUsers
> DBSource dbi:ODBC:MDBTest
> DBUsername
> DBAuth
> AddQuery insert into RADONLINE \
>
>
> (USERNAME, NASIDENTIFIER, NASPORT, ACCTSESSIONID, TIME_STAMP,
> FRAMEDIPADDRESS, SERVICETYPE, CALLEDSID) \ values \
> ('%n', '%N', %{NAS-Port}, '%{Acct-Session-Id}', %{Timestamp},
> '%{Framed-IP-Address}', '%{Service-Type}', '%{Called-Station-Id}')
>
> </SessionDatabase>
>
> <Realm>
>
> #-----------------------------------------------------------------------
> #
> # This is for Aythenticating Authorizing and Accounting the hourly users
> #
> #-----------------------------------------------------------------------
>
>
> #------------------------------------
>
> MaxSessions 1
> AuthByPolicy ContinueUntilAccept
>
> <AuthBy SQL>
> # Change DBSource, DBUsername, DBAuth for your database
> # See the reference manual
> DBSource dbi:ODBC:MDBTest
> DBUsername
> DBAuth
>
> AccountingStopsOnly
> AccountingTable Accounting
> AcctColumnDef UserName,User-Name
> AcctColumnDef CallDate,Timestamp,integer-date
> AcctColumnDef AcctStatusType,Acct-Status-Type,integer
> 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 NASIdentifier,NAS-Identifier
> AcctColumnDef NASIdentifier,NAS-IP-Address
> AcctColumnDef NASPort,NAS-Port,integer
>
> # You can use this to force Radiator to limit
> # maximum session times to how many minutes
> # are left in subaccounts.timeleft
>
> # AcctSQLStatement update Authentication set BalanceTime =
> (BalanceTime)-0%{Acct-Session-Time}, \ AcctSQLStatement update
> Authentication set %Q = %Q-0%{Acct-Session-Time} \ #, Last = '%Q' \
> where USERNAME = '%n' \
> And Type = 'H'
>
> #
> </AuthBy>
>
>
>
> <AuthBy SQL>
> # Change DBSource, DBUsername, DBAuth for your database
> # See the reference manual
> DBSource dbi:ODBC:MDBTest
> DBUsername
> DBAuth
>
> AuthSelect select Password from Authentication where USERNAME='%n' And
> Type='P'and ExpiryDate > now()
>
> AuthColumnDef 0,Password,check
> #AuthColumnDef 1,Session-Timeout,reply
> AddToReply Service-Type = Framed,Framed-Protocol = PPP
> # #DefaultReply Service-Type = Framed,Framed-Protocol = PPP
> # You can add to or change these if you want.
>
> </AuthBy>
>
> <AuthBy SQL>
> # daily control
> # Change DBSource, DBUsername, DBAuth for your database
> # See the reference manual
> DBSource dbi:ODBC:MDBTest
> DBUsername
> DBAuth
> #AuthSelect select Password, %Q from Authentication where USERNAME='%n'
> And %Q > 0 And Type='H' And Last <> '%Q' And ThursdayFrom < %H AuthSelect
> select Password, %Q from Authentication where USERNAME='%n' And %Q > 0 And
> Type='H' And %QFrom < %H And %QTo > %H and (IP1=%{NAS-Port} or (IP1=0 and
> IP2=0) or IP2=%{NAS-Port})
>
>
> AuthColumnDef 0,Password,check
> AuthColumnDef 1,Session-Timeout,reply
> AddToReply Service-Type = Framed,Framed-Protocol = PPP
> </AuthBy>
>
> </Realm>
>
>
> and this is trace 4 debug:
>
>
>
>
> Wed Jun 13 12:42:35 2001: DEBUG: Packet dump:
> *** Received from 127.0.0.1 port 3572 ....
> Code: Access-Request
> Identifier: 31
> Authentic: 1234567890123456
> Attributes:
> User-Name = "ray"
> Service-Type = Framed
> NAS-IP-Address = 203.63.154.1
> NAS-Port = 1234
> Called-Station-Id = "123456789"
> Calling-Station-Id = "987654321"
> NAS-Port-Type = Async
> User-Password = "<205><184>m<156><175>\<4><246><188>8<9><160><216>}x<153>"
>
> Wed Jun 13 12:42:39 2001: DEBUG: Handling request with Handler 'Realm='
> Wed Jun 13 12:42:39 2001: DEBUG: Deleting session for ray, 203.63.154.1,
> 1234 Wed Jun 13 12:42:39 2001: DEBUG: do query is: delete from RADONLINE
> where NASIDENTIFIER='203.63.154.1' and NASPORT=01234
>
> Wed Jun 13 12:42:44 2001: DEBUG: Query is: select NASIDENTIFIER, NASPORT,
> ACCTSESSIONID, FRAMEDIPADDRESS from RADONLINE where USERNAME='ray'
>
> Wed Jun 13 12:42:45 2001: DEBUG: Handling with Radius::AuthSQL
> Wed Jun 13 12:42:45 2001: DEBUG: Handling with Radius::AuthSQL
> Wed Jun 13 12:42:45 2001: DEBUG: Query is: select Password,BalanceTime from
> Authentication where USERNAME='ray' And ((BalanceTime > 0 And Type='H') or
> Type='P')
>
> Wed Jun 13 12:42:46 2001: DEBUG: Radius::AuthSQL looks for match with ray
> Wed Jun 13 12:42:46 2001: DEBUG: Radius::AuthSQL ACCEPT:
> Wed Jun 13 12:42:47 2001: DEBUG: Access accepted for ray
> Wed Jun 13 12:42:47 2001: DEBUG: Packet dump:
> *** Sending to 127.0.0.1 port 3572 ....
> Code: Access-Accept
> Identifier: 31
> Authentic: 1234567890123456
> Attributes:
> Service-Type = Framed
> Framed-Protocol = PPP
>
> Wed Jun 13 12:42:47 2001: DEBUG: Packet dump:
> *** Received from 127.0.0.1 port 3572 ....
> Code: Accounting-Request
> Identifier: 32
> Authentic: <213><234>><144>qF<153><13>i<249>Y+<151>AYR
> Attributes:
> User-Name = "ray"
> Service-Type = Framed
> NAS-IP-Address = 203.63.154.1
> NAS-Port = 1234
> NAS-Port-Type = Async
> Acct-Session-Id = "00001234"
> Acct-Status-Type = Start
> Called-Station-Id = "123456789"
> Calling-Station-Id = "987654321"
>
> Wed Jun 13 12:42:47 2001: DEBUG: Handling request with Handler 'Realm='
> Wed Jun 13 12:42:47 2001: DEBUG: Adding session for ray, 203.63.154.1,
> 1234 Wed Jun 13 12:42:47 2001: DEBUG: do query is: delete from RADONLINE
> where NASIDENTIFIER='203.63.154.1' and NASPORT=01234
>
> Wed Jun 13 12:42:47 2001: DEBUG: do query is: insert into RADONLINE
> (USERNAME, NASIDENTIFIER, NASPORT, ACCTSESSIONID, TIME_STAMP,
> FRAMEDIPADDRESS, #NASPORTTYPE, SERVICETYPE, CALLEDSID) values ('ray',
> '203.63.154.1', 1234, '00001234', 992425367, #'', '', 'Framed',
> '123456789')
>
> Wed Jun 13 12:42:48 2001: ERR: do failed for 'insert into RADONLINE
> (USERNAME, NASIDENTIFIER, NASPORT, ACCTSESSIONID, TIME_STAMP,
> FRAMEDIPADDRESS, #NASPORTTYPE, SERVICETYPE, CALLEDSID) values ('ray',
> '203.63.154.1', 1234, '00001234', 992425367, #'', '', 'Framed',
> '123456789')': [Microsoft][ODBC Microsoft Access 97 Driver] Syntax error in
> INSERT INTO statement. (SQL-37000)(DBD: st_prepare/SQLPrepare err=-1) Wed
> Jun 13 12:42:52 2001: ERR: do failed for 'insert into RADONLINE (USERNAME,
> NASIDENTIFIER, NASPORT, ACCTSESSIONID, TIME_STAMP, FRAMEDIPADDRESS,
> #NASPORTTYPE, SERVICETYPE, CALLEDSID) values ('ray', '203.63.154.1', 1234,
> '00001234', 992425367, #'', '', 'Framed', '123456789')': [Microsoft][ODBC
> Microsoft Access 97 Driver] Syntax error in INSERT INTO statement.
> (SQL-37000)(DBD: st_prepare/SQLPrepare err=-1) Wed Jun 13 12:42:52 2001:
> DEBUG: Handling with Radius::AuthSQL
> Wed Jun 13 12:42:52 2001: DEBUG: Handling accounting with Radius::AuthSQL
> Wed Jun 13 12:42:52 2001: DEBUG: Accounting accepted
> Wed Jun 13 12:42:52 2001: DEBUG: Packet dump:
>
> ===
> 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.
--
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. Available on *NIX, *BSD, Windows 95/98/2000, NT, MacOS X.
-
Nets: internetwork inventory and management - graphical, extensible,
flexible with hardware, software, platform and database independence.
===
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