Skip to content

LabEnbug/squid2radius

Repository files navigation

squid2radius

squid2radius analyzes your squid access.log file, and reports usage information to a RADIUS server using Accounting-Request as defined in RFC 2866.

After analyzing is finished, it calls squid to rotate your log file so that no lines will be counted more than once.

Installation

Clone Git repo

git clone git://github.com/jiehanzheng/squid2radius.git

Install dependencies

# install pip for python2, command varies if you are on a different OS
sudo pacman -S python2-pip

# install pyrad, command varies if you are on a different OS
sudo pip2 install pyrad

Usage

usage: squid2radius.py [-h] [-p RADIUS_ACCT_PORT]
                       [--radius-nasid RADIUS_NASID] [--squid-path SQUID_PATH]
                       logfile_path radius_server radius_secret

For instance, run like this if you have access log file at /var/log/squid/access.log, RADIUS server running at localhost with secret set to testing123:

python2 squid2radius.py /var/log/squid/access.log localhost testing123

It is certainly a good idea to make a cron job for this.

You should also read SquidFaq/SquidLogs to make sure your log files are in reasonable sizes.

About

Analyzes your Squid access.log file, and reports accounting information (data transfer) to a RADIUS server

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%