alSUMBilling

As you remember, this is complete solution for accouting all traffic (proxy+NAT) in you bussines.

This is alSAMSBilling + alLANBilling in one.

First you need to create a table “usersip” in your “ulog” table:

CREATE TABLE IF NOT EXISTS usersip (
id tinyint(4) NOT NULL auto_increment,
`user` varchar(20) NOT NULL,
ip varchar(15) NOT NULL,
PRIMARY KEY  (id),
UNIQUE KEY `user` (`user`),
UNIQUE KEY ip (ip)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1;

After creating this table you will need to feel it with real data.
In my network all computers have static IP-addresses (from DHCP)
One computer (IP) – one user (SQUID)
So you need to specify what IP have each user in this table.

Next you need to modify PHP-script (alsumbill.php) .
Change this parametrs to yours:
$host – MySQL hostname
$user – MySQL username (with read access to squidlog.cache and ulog.usersip and ulog.raw tables)
$pwd – MySQL password
$dbsquid – database with SAMS cache table (default: squidlog)
$dblan – database with data from flow-tools (default: ulog)
$dblantable – table name with data from flow-tools (default: raw)

Note. Trafic from squid by sams is incoming only! So
“Received”=LAN traffic+squid traffic
“Sent” =LAN traffic (only)

If you did all correctly, then you’ll see something like this:

 http://sourceforge.net/project/showfiles.php?group_id=201020&package_id=311744&release_id=664130