I have a fedore core 4 server up and running, and have been busy configuring mrtg.
Everything works fine, and i now want to display certain processes and their memory and cpu usage.
At first i thought i should use the ps command for this (with a perl script to get the values to mrtg) but i noticed there is a big difference between ps and top and free.
If i run free i get a reading of almost 100% free memory, but when i look at process X (just a name) with ps it says 4% mem usage.
The same happens for cpu usage, top sometimes says a process takes up 60% cpu, and the ps command stays at 1 or 2 %.
How is this possible, and what command is the one displaying what is REALLY going on?