Resource utilization for each user

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
Dude
Cacti User
Posts: 73
Joined: Wed Aug 11, 2010 11:44 pm

Resource utilization for each user

Post by Dude »

How can I graph the resources by each user on my centOS machine?
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Resource utilization for each user

Post by noname »

This is just an idea. (inspired from this page)
For example:

Code: Select all

% awk 'BEGIN{while("ps -eo user,pcpu,vsz"|getline){pcpu[$1]+=$2;vsz[$1]+=$3} FS=":"}{print NR,$1,pcpu[$1],vsz[$1]}' /etc/passwd

1 root 0.4 176320
2 daemon 0 37624
3 bin
4 sys
5 adm
6 lp
7 uucp
8 nuucp
9 postfix 0 5064
10 listen
11 gdm
12 webservd 0 115776
13 mysql 1 49776
14 cactiuser 10.2 67424
15 nobody
16 noaccess
17 itsme 0.6 17232
...
If these results can be retrieved on Cacti in some way (such like script query?), Cacti will be able to create graphs..
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Resource utilization for each user

Post by gandalf »

You may write custom scripts that spit out the required numbers. See e.g. 1st link of my sig
R.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests