Process, PID and total memory consumed on AIX.

Hi,

Below is the code snippet I use on Linux (Centos) to retrieve the Process Name, PID and memory consumed on Linux (Centos) host:-

top -b -n 1 | awk -v date="$tdydate" -v ip="$ip" 'NR>7 {print date","ip","$12,","$1,","$10}'

Any idea how the same can be retrieved on an AIX host? This doesn't seem to work on AIX.

Please provide the pointers available (if any).

Thanks.

This won't work mainly because of the absence of the "top" program in AIX.

I suggest using the ps command instead which - depending on options chosen - can offer BSD-like as well as SystemV-like functionality in AIX.

A possible start might look like:

ps -Alo pid,args,vsz

which displays the PID, the complete command to invoke the process and the virtual memory allocated (notice that the units are memory pages, not bytes).

You will perhaps find other (and more detailed) useful information going over the man page of ps and there the chapter about arguments to the -o option.

I hope this helps.

bakunin