||06-22-2009 11:10 AM
Originally Posted by mokona
I badly need help. Does anyone know any documentation I can refer to about monitoring the computer resources of an ubuntu linux machine (memory [RAM], hard disk, and cpu utilization). I need to make a perl script that would be able to give me the amount of how much these computer resources were used. pls help.
I would go with a batch script.
For memory use something like
for hard disk you can use
df -h // the -h is for human readable format
for cpu utilization you can use the top command I think there is an snapshot tag so that it won't go into realtime mode. Also for a deeper disk information look into using du it can give you a display of how much each directory is using in terms of space. Here is an example of du
if you run this from / it will give /, /root , /usr , /etc, /tmp, /var, /boot, /sbin, /bin
du -c -h --max-depth=1