Originally posted by: er!k
Hi Guys,
we are running a rather large AIX/Power environment and recently our customers want to know a little more about the utilization of the systems. The idea is to sum up all the cpu-cycles of all processes for a given pid for lets say every 30sec to display them in ganglia.
So in linux I would basically do the following:
-
get the cpu time for this pid from /proc/<pid>/stat
-
wait 30 sec
-
get the cpu time for this pid from /proc/<pid>/stat again
-
difference between the two cpu-time values divided by 30 sec multiplied with the factor (sec/jiffy)
This should give me something similar to what "top" or "topas" is reporting in %CPU
I know this is still not the whole truth due to SMT and CPU pooling and things. But how to get the %CPU in AIX in the first place?
Or is there any better way to figure out how many CPU ticks a certain process used in a given time?
Best,
Erik.
#AIX-Forum