1

I'd like to look at the aggregated usage information at a user level.

Basically hoping for a tool similar to htop but with the option to sum up all the processes for a user, for every user.

1 Answer 1

1

I think you want psacct (or acct on some systems). It will provide:

  • ac command prints the statistics of user logins/logouts (connect time) in hours.
  • lastcomm command prints the information of previously executed commands of user.
  • accton commands is used to turn on/off process for accounting.
  • sa command summarizes information of previously executed commands.
  • last and lastb commands show listing of last logged in users.

Install with

yum install psacct 

or

sudo apt-get install acct 

you then have to start the service

chkconfig psacct on /etc/init.d/psacct start 

Then you can use commands...

display total login time of each user

ac -p 

display total of a user user

ac user 

sa will give ps like usage stats... like

sa -m 

and

sa -c 

for processes and cpu minutes (this is the one you may be interested in).

I am not 100% sure if you want 100% htop compatible output, which is not what those will give you, but if you want stats like previous processes, percentages and usage, those two (out of all of those commands) will get you very close.

Most of that info was pulled from this article.

1
  • This looks great. but I'm not able to use sa without sudo permissions. ac works great though. Commented Nov 12, 2018 at 20:23

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.