(RADIATOR) MaxSession

2001-06-04 Thread Mohammed Adam

Hi all

i'm facing a problem with Maxsessions, it doesnt work the following is my Radius 
config file

#  

Foreground
LogStdout
LogDir  .
DbDir   .
DictionaryFile d:\radiator-demo-2.18\dictionary.cisco
Trace 4

# For testing: this allows us to honour requests from radpwtst 
# on the same host.

Secret mysecret
DupInterval 300

#
#   Secret mysecret
#   DupInterval 300
#




#Identifier OnlineUsers
DBSourcedbi:ODBC:MDBTest
DBUsername  
DBAuth  
AddQueryinsert into RADONLINE \


(USERNAME, NASIDENTIFIER, NASPORT, ACCTSESSIONID, TIME_STAMP, FRAMEDIPADDRESS, 
#NASPORTTYPE, SERVICETYPE, CALLEDSID) \ 
values \ 
('%n', '%N', %{NAS-Port}, '%{Acct-Session-Id}', %{Timestamp}, 
#'%{Framed-IP-Address}', '%{Port-Type}', '%{Service-Type}', '%{Called-Station-Id}') 





#---
#
# This is for Aythenticating Authorizing and Accounting the hourly users
#
#---


#

MaxSessions 1
AuthByPolicy ContinueUntilAccept


# Change DBSource, DBUsername, DBAuth for your database
# See the reference manual
DBSourcedbi: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'

# 





# Change DBSource, DBUsername, DBAuth for your database
# See the reference manual
DBSourcedbi: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.




# daily control
# Change DBSource, DBUsername, DBAuth for your database
# See the reference manual
DBSourcedbi: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






Thanks all

===
Archive at http://www.open.com.au/archives/radiator/
Announcements on [EMAIL PROTECTED]
To unsubscribe, email '[EMAIL PROTECTED]' with
'unsubscribe radiator' in the body of the message.



(RADIATOR) Maximum Session

2001-06-12 Thread Mohammed Adam

Hell All
Maximum session doesnt work with me, i think the problem is in RADONLINE inserinto but 
i couldnt find out why.

CFG File:



#Identifier OnlineUsers
DBSourcedbi:ODBC:MDBTest
DBUsername  
DBAuth  
AddQueryinsert into RADONLINE \


(USERNAME, NASIDENTIFIER, NASPORT, ACCTSESSIONID, TIME_STAMP, FRAMEDIPADDRESS, 
SERVICETYPE, CALLEDSID) \ 
values \ 
('%n', '%N', %{NAS-Port}, '%{Acct-Session-Id}', %{Timestamp}, '%{Port-Type}', 
'%{Service-Type}', '%{Called-Station-Id}') 





-
Log File


Tue Jun 12 13:11:07 2001: ERR: Could not open dictionary file 
'd:\radiator-demo-2.18\dictionary.cisco': No such file or directory
Tue Jun 12 13:11:26 2001: DEBUG: Packet dump:
*** Received from 127.0.0.1 port 4815 
Code:   Access-Request
Identifier: 20
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>"

Tue Jun 12 13:11:29 2001: DEBUG: Handling request with Handler 'Realm='
Tue Jun 12 13:11:29 2001: DEBUG:  Deleting session for ray, 203.63.154.1, 1234
Tue Jun 12 13:11:30 2001: DEBUG: do query is: delete from RADONLINE where 
NASIDENTIFIER='203.63.154.1' and NASPORT=01234

Tue Jun 12 13:11:31 2001: ERR: Could not open dictionary file 
'd:\radiator-demo-2.18\dictionary.cisco': No such file or directory
Tue Jun 12 13:11:33 2001: DEBUG: Query is: select NASIDENTIFIER, NASPORT, 
ACCTSESSIONID, FRAMEDIPADDRESS from RADONLINE where USERNAME='ray'

Tue Jun 12 13:11:34 2001: DEBUG: Handling with Radius::AuthSQL
Tue Jun 12 13:11:34 2001: DEBUG: Handling with Radius::AuthSQL
Tue Jun 12 13:11:34 2001: DEBUG: Query is: select Password,BalanceTime from 
Authentication where USERNAME='ray' And ((BalanceTime > 0 And Type='H') or Type='P')

Tue Jun 12 13:11:34 2001: DEBUG: Radius::AuthSQL looks for match with ray
Tue Jun 12 13:11:34 2001: DEBUG: Radius::AuthSQL ACCEPT: 
Tue Jun 12 13:11:34 2001: DEBUG: Access accepted for ray
Tue Jun 12 13:11:34 2001: DEBUG: Packet dump:
*** Sending to 127.0.0.1 port 4815 
Code:   Access-Accept
Identifier: 20
Authentic:  1234567890123456
Attributes:
Service-Type = Framed
Framed-Protocol = PPP

Tue Jun 12 13:11:34 2001: DEBUG: Packet dump:
*** Received from 127.0.0.1 port 4815 
Code:   Accounting-Request
Identifier: 21
Authentic:  <246><200>*<172><149><4>\V<241>B)~<228>}<13><198>
Attributes:
User-Name = "ray"
Service-Type = Framed
NAS-IP-Address = 203.63.154.1
NAS-Port = 1234
NAS-Port-Type = Async
Acct-Session-Id = "1234"
Acct-Status-Type = Start
Called-Station-Id = "123456789"
Calling-Station-Id = "987654321"

Tue Jun 12 13:11:34 2001: DEBUG: Handling request with Handler 'Realm='
Tue Jun 12 13:11:34 2001: DEBUG:  Adding session for ray, 203.63.154.1, 1234
Tue Jun 12 13:11:34 2001: DEBUG: do query is: delete from RADONLINE where 
NASIDENTIFIER='203.63.154.1' and NASPORT=01234

Tue Jun 12 13:11:34 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, '1234', 992340694, 
#'', '', 'Framed', '123456789')

Tue Jun 12 13:11:35 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, '1234', 992340694, 
#'', '', 'Framed', '123456789')': [Microsoft][ODBC Microsoft Access 97 Driver] Syntax 
error in INSERT INTO statement. (SQL-37000)(DBD: st_prepare/SQLPrepare err=-1)
Tue Jun 12 13:11:38 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, '1234', 992340694, 
#'', '', 'Framed', '123456789')': [Microsoft][ODBC Microsoft Access 97 Driver] Syntax 
error in INSERT INTO statement. (SQL-37000)(DBD: st_prepare/SQLPrepare err=-1)
Tue Jun 12 13:11:38 2001: DEBUG: Handling with Radius::AuthSQL
Tue Jun 12 13:11:38 2001: DEBUG: Handling accounting with Radius::AuthSQL
Tue Jun 12 13:11:38 2001: DEBUG: Accounting accepted
Tue Jun 12 13:11:38 2001: DEBUG: Packet dump:
*** Sending to 127.0.0.1 port 4815 
Code:   Accounting-Response
Identifier: 21
Authentic:  <246><200>*<172><149><4>\V<241>B)~<228>}<13><198>
Attributes:

Tue Jun 12 13:11:38 2001: DEBUG: Packet dump:
*** Received from 127.0.0.1 port 4815 
Code:   Accounting-Request
Identifier: 22
Authentic:  8P<245>;<4>:i(<224><185><128><186>eP<187><250>
Attributes:

(RADIATOR) Radonline Insert into problem

2001-06-14 Thread Mohammed Adam

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.

Secret mysecret
DupInterval 300


Secret #
DupInterval 300





#Identifier OnlineUsers
DBSourcedbi:ODBC:MDBTest
DBUsername  
DBAuth  
AddQueryinsert 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}') 





#---
#
# This is for Aythenticating Authorizing and Accounting the hourly users
#
#---


#

MaxSessions 1
AuthByPolicy ContinueUntilAccept


# Change DBSource, DBUsername, DBAuth for your database
# See the reference manual
DBSourcedbi: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'

# 





# Change DBSource, DBUsername, DBAuth for your database
# See the reference manual
DBSourcedbi: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.




# daily control
# Change DBSource, DBUsername, DBAuth for your database
# See the reference manual
DBSourcedbi: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





 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 = "r