I am working on a project and testing it on Linux.
In my report I want to present a diagram for CPU/Memory load of the machine!
What is the best method to obtain these data!?
Should i write a bash script to periodically check this (e.g. reading /proc/stat)? does not this script produce load itself?
any lightweight script or program available?
you can use Nagios or Icinga(fork of Nagios) to monitor CPU/Memory load. Both support graphs on the parameters monitored. Both have plugins to easily monitor CPU/Memory usage.
Setting up nagios on a linux machine via the package manager is pretty straight forward. Icinga supports automatic PDF reports generation, that also contain the graphics for the parameters monitored.
Icinga provides a virtual appliance – so it’s pretty easy to setup.