Port Accounting & Collection Tool (PACT) utilizes SNMP for effective port-accounting in software.
The idea behind PACT is based on an old script developed by the creator that utilized snmpwalk with some shell script magic to do accounting on various routers. However, the original version included two significant drawbacks. First, if the internal offset of a port changed, the script would start recording the wrong port. Second, the speed factor was a problem, as it took between 3 and 7 minutes to go through 15 routers and calculate and store the port counters in the database.
PACT addresses these drawbacks. All ports are now addressed by their symbolic name, and speed issues have significantly improved, taking approximately 1 second per router, switch, hub, etc. Moreover, a nice UI has been added, permitting anyone to alter or create entries or config options.
PACT consists of several different parts that depend on the kind of work being done and utilize a combination of programs, tools, and libraries. The core program, the data collector, is derived from an example program from the ucd-snmp-package. It is coded entirely in C and utilizes the libsnmp from the ucd-snmp-package. The data is collected using configuration data obtained from a MySQL database, which is also used to store the collected data.
All UI-specific work uses HTML pages, with most of them utilizing PHP and its MySQL routines to display and administer dynamic data like host, customer, and port data. Finally, tools to consolidate the collected data and reduce the amounts by adding up on a day-to-day basis were intended in C for performance reasons. However, they were written as PHP/SQL-scripts since almost all the work is done in the core of MySQL, so the frontend-performance isn't too critical.
Aside from SNMP-ports, PACT can also be used to perform accounting for just about anything that can be counted. To date, an extra program exists (for registered users) that converts Apache http-logs into PACT data. This was required because doing accounting for virtual servers running on a single IP is impossible via SNMP.
However, PACT has some limitations, like being limited to three separate SNMP hosts, but otherwise functionally unlimited.
Version 1.0: N/A