soyuka / pidusage

Cross-platform process cpu % and memory usage of a PID
MIT License
512 stars 55 forks source link

AIX is not supported #4

Closed smartmouse closed 10 years ago

smartmouse commented 10 years ago

I was trying to run pm2 test on AIX platform but got the following message:

Error retrieving process list: Error: aix is not supported yet, please fire an isue (https://github.com/soyuka/pidusage). Hopefully this will be supported soon on AIX., Thanks you

soyuka commented 10 years ago

I was thinking about it yesterday! Could you give me the result of: ps -o pcpu,rss -p some_pid. I just need to know if the command works. Is there a /proc folder in aix?

soyuka commented 10 years ago

AIX doesn't have any /proc/pid/stat file nor /proc/uptime. I need some alternatives to this (:. What is your version? I have no AIX access, I could really need a hand here!

smartmouse commented 10 years ago

Running AIX 6.1.0.0 and AIX 7.0.0.0

-bash-4.2$ ps -u pcpu,rss -p 15401046 UID PID TTY TIME CMD 3005 15401046 - 0:00 node

yes , there is /proc on AIX

-bash-4.2$ ls -l /proc/sys total 0 dr-xr-xr-x 13 root system 0 04 Jun 12:08 aio dr-xr-xr-x 6 root system 0 04 Jun 12:08 fs dr-xr-xr-x 6 root system 0 04 Jun 12:08 iodone dr-xr-xr-x 4 root system 0 04 Jun 12:08 lvm dr-xr-xr-x 12 root system 0 04 Jun 12:08 posix_aio

-r--r--r-- 1 root system 93 04 Jun 12:07 version

soyuka commented 10 years ago

ps -o pcpu works but I can't get the rss :/.

# ps -o pcpu -p 131136
 %CPU
  0,0

I can't find any equivalence to : /proc/uptime and /proc/{pid}/stat in my old AIX version... Any suggestions?

soyuka commented 10 years ago

Could you try installing the package from the git repository and see if your results seems to be consistent? I can't install nodejs on AIX right now.

ps isn't accurate on linux systems compared to /proc informations but it should work too! If you find a way to get an uptime (in seconds) and same informations as /proc/{pid}/stat in linux feel free to share your informations or PR.

Thanks!

Btw seems that the ibm site is down to me atm :/.

smartmouse commented 10 years ago

http://www-01.ibm.com/support/knowledgecenter/ssw_aix_71/com.ibm.aix.cmds5/uptime.htm?lang=en

Hey on AIX. they have an uptime command

soyuka commented 10 years ago

Yes I'm aware of that but I have no aix system to test or develop on this :/.

smartmouse commented 10 years ago

Hey, it is working now :-) Thank you.so so so much, -bash-4.2$ npm install pidusage pidusage@0.1.0 node_modules/pidusage

Pcpu: 0 Mem: 26 MB Pcpu: 0 Mem: 27 MB

2 passing (2s)

-bash-4.2$

soyuka commented 10 years ago

:-)