A Python application for logging data usage by machines on a network
Requires iptables and mysql to be available and the machine the code is running on needs to see all the data you want to record (we ran it on a router box).
Usage is:
-
Run start.py once to create iptables rules.
-
Run log.py as regularly as you like, it will log a database entry each time it is run for each MAC address that was seen during the window. 15 minutes is an appropriate window.
-
Run end.py once to teardown iptables rules.
-
You can add a web interface to read the usage, or just run the provided SQL statement from the commandline to get a readout of usage per MAC address.