Disk space and RAM status in UNIX

I have an application which is running under AIX, HP UNIX, SCO, and LINUX(redhat and SuSE). and its dealing with some bulk amount of file handling, and some of my boxes are not very good in terms of resources like memory and disk space. so i wanted to know the statistics of each of my boxes. Like

  • Total Amount of RAM
  • Available RAM ( at this time)
  • Total amount of Disk space
  • Disk space available ( at this time)

All these details i needed in terms of MegaBytes.

Can anyone tell me the best way to get these statistics in the above mentioned UNIX variants? thanks in advance.

I think you could give a try to sysinfo().

it would vary by the vendor (or distro...), and so there's not really a one size fits all approach to give. Top and Vmstat might offer some insight, but again they're not present on all systems...so you're going to need to roll your own.