tummy.com: we do linux

radiusContext

Introduction

radiusContext is a RADIUS (Remote Authentication Dial In User Services) accounting log analysis package. It includes a web interface which users can log into using their RADIUS login and password to view their current and previous months usage. It currently works with just about every RADIUS server out there that writes Livingston-compatible detail files, including:

Mailing list

radiuscontext-discuss

Download

FTP: ftp.tummy.com:/pub/tummy/radiusContext/

Recent changes

WHATSNEW (first 15 lines):

<Unable to find WHATSNEW file>

Press

DaveCentral's Best of Linux for February 28, 2001

Requirements

Python: a current version (1.5.1+) to work. You can get source (and binaries for selected systems) from www.python.org.

pyrad: The web-based interface requires pyrad to be installed. pyrad requires Python versions 2.1 or higher. This is only required for the web interface.

The Apache Webserver: The web-based interface requires Apache or another web server which can run CGIs.

radiusContext works with Livingston RADIUS and MERIT RADIUS accounting logs, and it should be easy to add other formats.

Description and License

It comes with full source code. You may modify copies of it for your own use, but you may not redistribute modified copies without our permission. If you have patches, bug reports or suggestions for improvement, please contact us at radiusContext@tummy.com.

Sample Reports

Inspiration

It was modeled after the radiusreport package (http://www.pgregg.com/projects/radiusreport/). radiusContext is meant to deal with a few short-comings of radiusreport, but of course has a few of it's own:

Advantages

Disadvantages

Getting Started

radiusContext creates a database called "SessionData" in the current directory. This name can be specified using the "-d" option to the commands. Data is processed in two stages, importing of the data into the database (which can be done incrementally) and report generation.

To create the database, use "raddetail". The detail file names can be specified on the command-line, or can be piped from standard input. Now, to create the report run "mkdir report" and "stdreport -H report -T report". You will end up with text and HTML files in a subdirectory called "report". There is an "index" and "index.html" file created which includes an overall report. The "index.html" file has hyper-links to the detail files.

Running radiusContext

radiusContext runs in two stages. The first stage parses the detail file and adds the records to a database. This stage can be run however often you want, with whatever data you have. For example you could run it daily... Then if you want to produce monthly reports, remove or rename the database after the last run of the month. This phase only requires about 5% of the database size in RAM, and is quite disc-intensive.

The second stage takes the database and generates a report. This stage can be fairly lengthy, so you probably want to run it at night, and no more often than once a day. Memory used during this phase is roughly 15% of the database size, though I'm planning on making it even more stingy in the future. This phase is also quite disk-bounded, so while it doesn't use much processor time, your discs may be very busy.

Reports are generated in both HTML and text form. Other back-ends can be created and plugged in quite easily.

Command line Switches

raddetail takes the following command-line switches:

   [ -L | --dblib <name> ]          Specify db file format to use.
   [ -d | --database <file> ]       Specify database file name.
   [ -v | --verbose  ]              Display details of run.
   [ --version  ]                   Display program version.
   [ --transform-user-lowercase  ]  Convert the user name to lower-case.
   [ --transform-user-stripdomain ] Remove the domain from a user name.
   [ --transform-user-appenddomain=domain ]
                                    If no user name has no domain,
                                    add 'domain' (no @ is included unless
                                    specified in 'domain').
   [ -h | -? | --help  ]            Display this usage message.

stdreport takes the following command-line switches:

   [ -L | --dblib <name> ]          Specify db file format to use.
   [ -d | --database <file> ]       Specify database file name.
   [ -D | --reportdir <dir> ]       Specify report directory name.
   [ -g | --generate <type> ]       Select reports to generate.
                                    (May be used several times).
   [ -C | --csvreportdir <dir> ]    Specify CSV directory name.
   [ -H | --htmlreportdir <dir> ]   Specify HTML directory name.
   [ -A | --htmlascendreportdir <dir> ]
                                    Specify HTML-Ascend directory.
   [ -T | --textreportdir <dir> ]   Specify text directory name.
   [ -R | --rawreportdir <dir> ]    Specify RAW directory name.
   [ -s | --split-num <n> ]         Second-level report dirs are the
                                    first 'n' chars of login.  (use 0
                                    to not create subdirectories)
   [ --secsconv-limit <s> ]         Limit the time conversion to at most
                                    the specified limit.  This can be a
                                    number of seconds, or a name such as
                                    as 'hours', 'days', or 'minutes'.
                                    'days', or 'minutes'.
   [ -u | --user  ] <user name>     Limit report to <user> (may be
                                    specified multiple times)
   [ -v | --version  ]              Display program version.
   [ -h | -? | --help  ]            Display this usage message.

Copyright

radiusContext (source, binaries, report formats, documentation and all related matter) is copyright © 1998-2004 Sean Reifschneider, tummy.com, ltd.