(RADIATOR) empty Authselect/AccountingTable

Darwin A. Bawasanta marsmalow at skyinet.net
Wed Nov 28 21:09:02 CST 2001


hi Hugh/Mike, i hope you guys are doing well.

i'd like to get your opinion as to whether this config will serve me right
and at the same to solicit other neat ways of implementing my requirements.

we recieve every now and then duplicate STOP packets from our various NAS,
however, in this particular case, we deduct the session-timeout values
against the "value" (in our table) but we are seeing double or multiple
deductions from the same SESSION-IDs.

so i'm thinking of adding sort of a flag that tells RADIATOR when to deduct
and otherwise.  i'd like to clarrify some things.

1. what should be the proper AuthByPolicy to use here?  making sure that
everybody gets authenticated and all accounting packets get processed.
2. are the sequence of my cascading AuthBys correct?  or do i have to
transfer the AuthPolicy after the StopAcctng?
3. i've tried testing the config but i don't seem to get the accounting
packets at all.
4. will this config ever work in the first place?

thanks in advace.


--------
<Handler Realm=/acme.com$/i>
        AcctLogFileName /acct/logs/acctlog
        MaxSessions 	1
        AuthByPolicy 	ContinueUntilReject

        AuthBy		AuthPolicy
	  AuthBy		StartAcctng
	  AuthBy		StopAcctng

</Handler>

<AuthBy SQL>
	Identifier 	    AuthPolicy
	DBSource        dbi:mysql:radius:xxx.xxx.xxx.xxx
	DBUsername      xxx
	DBAuth          xxx

	AuthSelect select password, value, value from users \
                   where username='%n' and status = 1 and value > 0 \
                   and valid_until>= "'%Y'-'%m'-'%d'"

        AuthColumnDef 0, User-Password, check
        AuthColumnDef 1, Session-Timeout, reply
        AuthColumnDef 2, Ascend-Maximum-Time, reply

	AccountingTable

        AddToReply Service-Type = Framed-User,\
        Framed-Protocol = PPP, \
        Framed-MTU = 1500, \
        Framed-Routing = None, \
</AuthBy>

<AuthBy SQL>
      Identifier 	StartAcctng

	DBSource        dbi:mysql:radius:xxx.xxx.xxx.xxx
	DBUsername      xxx
	DBAuth          xxx

	AuthSelect

	AccountingStartsOnly

        AccountingTable radacctng
        AcctColumnDef   USERNAME,User-Name
        AcctColumnDef   TIME_STAMP,Timestamp,integer
        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,integer
        AcctColumnDef   ACCTTERMINATECAUSE,Ascend-Disconnect-Cause,integer
        AcctColumnDef   FRAMEDIPADDRESS,Framed-Address
        AcctColumnDef   NASIDENTIFIER,NAS-Identifier
        AcctColumnDef   NASPORT,NAS-Port,integer
        AcctColumnDef   DNIS,Caller-Id
        AcctColumnDef   CLASS,Class
        AcctColumnDef   RATE,Connect-Speed,integer
        AcctColumnDef   RATE,Ascend-Xmit-Rate,integer

	  # setting initial login date and expiry dates
	  AcctSQLStatement update users set ......

        AcctSQLStatement update users set deduct = "T" where username='%n'

</AuthBy>


<AuthBy SQL>
      Identifier 	StopAcctng
	DBSource        dbi:mysql:radius:xxx.xxx.xxx.xxx
	DBUsername      xxx
	DBAuth          xxx

	AuthSelect

	AccountingStopsOnly

        AccountingTable radacctng
        AcctColumnDef   USERNAME,User-Name
        AcctColumnDef   TIME_STAMP,Timestamp,integer
        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,integer
        AcctColumnDef   ACCTTERMINATECAUSE,Ascend-Disconnect-Cause,integer
        AcctColumnDef   FRAMEDIPADDRESS,Framed-Address
        AcctColumnDef   NASIDENTIFIER,NAS-Identifier
        AcctColumnDef   NASPORT,NAS-Port,integer
        AcctColumnDef   DNIS,Caller-Id
        AcctColumnDef   CLASS,Class
        AcctColumnDef   RATE,Connect-Speed,integer
        AcctColumnDef   RATE,Ascend-Xmit-Rate,integer

        AcctSQLStatement update users set \
          value = value - 0%{Acct-Session-Time} where username='%n' and
deduct="T"

        AcctSQLStatement update users set deduct = "F" where username='%n'

</AuthBy>




--
  __
OO- `. Darwin A. Bawasanta                     marsmalow at skyinet.net
*  ||| Systems Development Manager      SKYCablenet/SKYinternet Inc.
L_(_/  Ofc: +63 32 253-6677                 Mobile: +63 917 486-5033
  |||==
 ((_|  "If the facts don't fit the theory, change the facts."

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