I wrote a program that reads detail files and produces CVS or Tab delimited data as
well it can connect to a PostgreSQL database and insert records directly. I have not
compiled the program in quite a while, but use it to "pull" data out of detail records
that I don't collect currently.


Example:

parserad -m c -i detail.2003Dec01 -o - -a /tmp/att.map \
| grep 207.34.60.83 \
| cut -d , -f 2 -f 24 \
| sort \
| uniq -c

using an attribute map of :

#start
Time-Stamp = Time-Stamp
Acct-Status-Type = Acct-Status-Type
...snip...
Acct-Delay-Time = Acct-Delay-Time
Connect-Info = Connect-Info
end = end

Generates :

  1 'Start',28000
  1 'Start',36000
  1 'Start',41333
  1 'Stop',28000
...snip...
 45 'Stop',26400
 46 'Start',26400
 57 'Stop',45333
 65 'Start',45333

This is the Help output:

parserad [-c configfile] [-i detailfile] [-o outputfile] [-a] [-f format] [-h]
[-m [t|c [-s s]|s [-H host] [-D database] [-T table] [-U user] [-P password]]]


Option Comment default
--------------- ------------------------------------------------ ---------------
-h Display this help screen.
-c configfile Alternate config file. [parserad.conf]
-a attributes Attribute map file. [attribute.map]
-i detailfile Radius detail input file to be parsed. [detail]
-o outputfile Output file. [radacct.csv]
-r Replace outputfile or create new file.
-s s Seperator character for CSV mode. [,]
-f format Input file format string, double qoutes are
stripped from the input file and the seperator
must have white space around any characters. [%s = %s]
-m c CSV output mode. default
-m t TAB delimited output mode.
-m s Direct SQL insert mode.
-H host Host name of SQL Server. [localhost]
-p port TCP port on SQL server. [5432]
-D database Database name on SQL server. [radius]
-T table Table name in database for inserting records. [detail]
-U user User name to access SQL server.
-P password Password for user accessing SQL server.
-v Show comma seperated record as it is processed.


If detailfile is '-' then input is from STDIN.
If outputfile is '-' then output is to STDOUT.

If your interested in getting this program contact me off list.

Ryan Ghering wrote:

Does anyone know of a script to import data from livingston radius to freeradius mysql ?
If so where is the beast and how do I get my hands on it?


Thanks
Ryan


- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html




-- Guy Fraser Network Administrator The Internet Centre 780-450-6787 , 1-888-450-6787




- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to