|
|
 |  |
Re: Radius log file importing.From: Matt Simerson Date: Sunday, August 2, 1998
Time: 6:41:01 pm
OK, after wasting an entire day discoving the following, I'll share it
with you in the hopes it saves you some time at some point:
There's pleny of perl scripts for parsing radius files. All of them have
their own handy format for exporting data and none seem to be what
Optigold is looking for. The closest is radquick from livingston's web
site. It's nice enough that it will scan all the files in your
/usr/adm/radacct (or wherever you rad logs are), and export a report like
the following:
wolfen 377:37:56 71 0
wolson 13:22:35 40 0
woodsong 1:54:47 10 0
wrandall 24:37:22 53 0
wseger 9:29:52 28 0
The fourth field is used to associate a cost with the call and I don't
know what Shawn uses that second time field for anyway so I leave it at
zero for now. I haven't hacked it yet to include bandwidth totals but I'll
get at that shortly.
The prompt in Optigold request the following format:
login,hh:mm:ss, # calls, sec hh:mm:ss, bandwidth
Since Optigold wants it comma delimited it suck it into BBEdit on my mac
and replace all whitespace with a comma. This could just as well be done
in the script or with a tool like tr. I'll make this part of my version of
radquick at some point.
> Parser is an unlocked FileMaker Pro file, so you can make any changes to
> it you want...
While that's all fine and dandy, there's a plethora or problems with
Parser.USR. The first obvious one is that it won't handle radius files
directly. First the files must be pre-processed to replace all
<newline><tab> instances with <tab> characters. While this is easy enough
with a tool like BBEdit, it's a PITA and just one more manual step.
Why is it such a pain? Well, when you're dealing with a 30MB radius log
file (which is only one of the 5 log files that need processing) it takes
a while to move the file around. BBEdit can do the entire search and
replace in about 5 seconds but it takes nearly a minute to open the file
across the network, and then save it.
Once I did the replacement I tried importing the file into Parser.USR.
FileMaker 4.0v1 on my PowerMac 8500 with 112MB of RAM choked immediately
with a type 1 error. I increased FileMaker's memory allocation to way more
than necessary and still got the same results. I then tried doing it with
FileMaker 3.0 on the mac and it still choked.
Finally, I moved the files over to the NT machine and was able to suck in
3 of the smaller files but it hung when it got to the larger file(s). I
could grep the files and save only Stop records but it probably still
wouldn't do it. I think with only 64MB of RAM in the NT machine, it's
crippled.
So, I never did get any useful data out of parser but I did get a perl
script parsing away and I'll refine it further so that at the end of the
month there's a file in my home directory waiting for me to import into
Optigold. I'd be curious to hear how others have accomplished this task on
their system(s).
Matt
``````````````````````````````````````````````````````````````````
Matt Simerson http://users.michweb.net/~matt
MichWeb Inc. - President http://www.michweb.net
The Art Farm - Technical Wizard http://www.theartfarm.com
ISP/C Board of Directors http://www.ispc.org __o
_-\<,_
Signed up for ISPF yet? ......(_)/ (_)
If you're in the ISP industry, you should! http://www.ispf.org
``````````````````````````````````````````````````````````````````
|

Return to Digital Point Solutions' Home Page |