[RADIATOR] run perl hook after accounting start

Thomas Kurian thomas at kccg.com
Wed Mar 6 07:57:36 CST 2013


Dear All,
Below is a description of my requirements.


1. After receiving a accounting start packet , If (switched=false 
,type=Q and quotacounter> or = quotamax)
The above values are to be compared with the current values of these 
fields in a sql table called quotasubscribers (field names are 
switched,type , quotacounter and quotamax).

2. If the above conditions matches, then a perl script is to be run . ( 
Which type of hook is to be called when the scenario is "after an 
accounting stack packet is received"?)

The following is my current radiator configuration (for reference with 
the above) , kindly answer with respect to below and add required config 
lines to the below config.

AcctPort 1813
BindAddress 0.0.0.0

LogDir /var/log/radius
DbDir /etc/radiator
# Use a low trace level in production systems. Increase
# it to 4 or 5 for debugging, or use the -trace flag to radiusd
Trace 4

# You will probably want to add other Clients to suit your work site,
# one for each NAS you want to work with


<Client DEFAULT>
Secret XXXX
DupInterval 0
</Client>


<Client 10.50.1.4>
Secret XXXX
DupInterval 0
NasType Cisco
IgnoreAcctSignature
</Client>

# Accept processing of other accounting requests of the genre stop


<Handler Request-Type = Accounting-Request>
PreProcessingHook file:"/etc/radiator/createavpairs.pl"
<AuthBy SQL>

DBSource dbi:ODBC:IRONMAN
DBUsername XXXXX
DBAuth XXXX


#AccountingStopsOnly
AccountingTable ACCOUNTING
AcctColumnDef USERNAME, User-Name
AcctColumnDef ACCTSTATUSTYPE,Acct-Status-Type
AcctColumnDef FRAMEDIPADDRESS,Framed-IP-Address
AcctColumnDef ACCTINPUTOCTETS,Acct-Input-Octets,integer
AcctColumnDef ACCTOUTPUTOCTETS,Acct-Output-Octets,integer
AcctColumnDef TIME_STAMP,Event-Timestamp,integer-date
AcctColumnDef ACCTSESSIONTIME,Acct-Session-Time,integer
AcctColumnDef ACCTDELAYTIME,Acct-Delay-Time,integer
AcctColumnDef ACCTSESSIONID,Acct-Session-Id
AcctColumnDef ACCTTERMINATECAUSE,Acct-Terminate-Cause
AcctColumnDef NASIDENTIFIER,NAS-Identifier
AcctColumnDef NASPORT,NAS-Port,integer
AcctColumnDef PARENTSESSIONID,parent-session-id

AcctSQLStatement update quotasubscribers set monthlycounter = 
monthlycounter + 0%{Acct-Output-Octets}, totalcounter = totalcounter + 
0%{Acct-Output-Octets}, timestamp = %{Event-Timestamp} \
where username='%n' \
And Type = 'Q'



</AuthBy>
#Log accounting to a detail file
AcctLogFileName %L/detail


</Handler>




<Handler Request-Type=Disconnect-Request>
<AuthBy RADIUS>

<Host 10.50.1.4>
Secret XXXX
</Host>
</AuthBy>
</Handler>

-- 
Best Regards,

Thomas Kurian
IT Security Engineer (B.Tech. – Electrical)
Kuwaiti Canadian Consulting Group (www.kccg.com)
T: +965 22435566
F: +965 22415149
E: thomas at kccg.com




More information about the radiator mailing list