http://www.it.hq.nasa.gov/~cshenton/radacct
Originally, I wrote it to parse Livingston Portmaster logs in
pre-RADIUS-2.0 format, then I rewrote and extended it to handle Ascend
format. I have *not* gone back and rationalized it to work with the
PortMaster RADIUS reports, or to use the new 2.0 file formats. Perhaps
when I have time... or if someone else would like to. Should be just
some changes to the parsing section.
Also note that it's Perl-4. I've tried to make it readable, but there
are some hairy structures that might be better re-implemented in
Perl-5.
We run it here out of cron on a weekly and monthly basis, generating
different reports each time. Below is the help message it gives you;
this should explain the reporting capabilities it offers.
The -c/-C option will probably not be useful to you directly: we use
it to query our X.500 service for user names, departments, etc -- but
you could probably use this as a basis for your own similar look-ups.
I have cron renaming the radius accounting "detail" file at midnight
to a date-suffixed file, one per day. Then I run the "radacct" script
against the week's, month's, or whatever files I am interested
in. Example:
radacct -Ssessions.Jan -Ttime.Jan -Ddaily -Pports detail.1997.01-*
Hummm... I see the short help doesn't agree with the long
help; the long help is correct. Sorry. Gotta fix that. :-(
--Chris
cshenton<1> ./radacct
Usage: radacct [-e|-Eefile] [-h|-Hhfile] [-p|-Ppfile] [-s|-Ssfile] [-t|-Ttfile] detailfile ...
radacct -h (for detailed help)
cshenton<2> ./radacct -h
Compile usage statistics from RADIUS detail file(s) and generate reports.
Parse the detail file's multi-line data per start/stop event.
Combine related start-stop data into one record, then aggregate
and collate events into sessions, cluster sessions by users,
calculating running totals, and finally grand totals.
Usage: radacct [-e|-Eefile] [-d|Ddfile] [-p|Ppfile] [-s|-Ssfile] [-t|-Ttfile] detailfile ...
You can have multiple reports generated simultaneously.
Capitalized options take filename arguments for their output data.
-e|-E: events (starts and stops) sorted as the log file is.
This is the simplest data-reduction,
suitable for further postprocessing, eg: for port-utilization.
-s|-S: sessions (start to stop) sorted by user (separated by form-feed).
Each user cluster is a log of usage, like on a phone bill;
and total times are cumulative leading to a total on the last.
-t|-T: total time per user (minutes) with number of sessions and average time.
Most concise report, suitable for import into billing software.
-d|-D: daily usage by hour.
-p|-P: port usage over all ports.
-c|-C: HQ Code usage; can take a while for X.500 lookups.