I want to monitor CPU usage, disk read/write usage for a particular process, say ./myprocess
.
To monitor CPU top
command seems to be a nice option and for read and write iotop
seems to be a handy one.
For example to monitor read/write for every second i use the command iotop -tbod1 | grep "myprocess"
.
My difficulty is I just want only three variables to store, namely read/sec, write/sec, cpu usage/sec. Could you help me with a script that combines the outputs the above said three variables from top
and iotop
to be stored into a log file?
Thanks!