Monotring cpu and VMstat in Redhat Linux

Hi ,

Please some one help me out .

How to write a shell cript to monitor cpu usage vmstat and in Redhat linux .

vmstat out put should be in percentage.
Thanks in advance !!!!

As per vmstat manual, last five fields gives information pertaining to CPU. So you can use below command to extract them:-

vmstat | awk '/[0-9]/ { print $13, $14, $15, $16, $17 } '
1 Like