Hi,
Recently i have write a simple script to capture CPU high usage based on prstat but i found out that it did capture correctly. I need to capture the rows that contains CPU usage more than 3%. Below line which i thought will capture CPU usage based CPU column in prstat(9th parameter) which is more than 3 % but if any process CPU usage more than 10% it did not capture.
problem #2 is that /usr/bin/awk cannot read a number if a character is appended. Here in $9 a % character is appended. Work-around: /usr/bin/nawk
With the default print action
prstat 5 1 | nawk '($9+0 >= 3)'
The last line (summary) eventually matches. An extra condition excludes it