One of our customers asked to made a script, which will suspend his hosting customers if they are using too much resources.
The goal was to collect cpu usage by
1. apache and mod_php
The tool will get actual resource usage every 5 minutes and will save the data in a dbm database.
Actually, we started with apache resources usage.
The utility is collecting cpu usage per user , vhost and even requested url.
The first try could be downloaded here, available for Cpanel servers only.
I do not recommend at all to run it on non-Cpanel servers.