[CentOS] process accounting on 5.7

John Doe jdmls at yahoo.com
Mon Mar 26 08:57:09 EDT 2012


From: Alan McKay <alan.mckay at gmail.com>

> On Tue, Mar 20, 2012 at 7:11 AM, John Doe <jdmls at yahoo.com> wrote:
>>From a quick look, it does not seem to have a user entry in the 
> stats...
> UID and GID are there
> Anyone else have anything on this?

Indeed, I looked too fast and missed the IDs...
So, why not just something like this:
dump-acct /var/account/pacct | awk -F\| ' 
    { total_cpu += $4; cpu[$5] += $4;
      total_ram += $7; ram[$5] += $7 }
    END { for (x in cpu) { 
              print x" "int((cpu[x]*100)/total_cpu)"% "int((ram[x]*100)/total_ram)"%"; } } '
Or just 'sa -m'?

JD


More information about the CentOS mailing list