Johan Dowdy wrote:
> What do you mean by "access"?

I mean "read", sorry for the unclear question.

> A simple way to get the output would be(presuming the 8th column has the
> data you want):
> iostat -x | awk '{ print $8 }'
> This could be redirected to a file or processed ins a shell script etc.
> What is it that you want to "do' with the output?

I want to add performance monitoring functionality to a web applications.

I look for bottlenecks on each request.

For this I want to "read" several OS status indicators such as %b of "iostat -x".

What I was not sure about, was - what is the correct way to "read" the output of "iostat -x" (and of other similar commands, such as "top", etc.).

But from the posts, so far, it seems that the correct way is indeed to "parse" the output, which the command would normally send to the terminal, and to "find" my values in this output, relying that the command will always output the values in the given order/format.

This -

iostat -x | awk '{ print $8 }'

returns multi-row answer.

This (suggested in another post) -

iostat -x | grep ad0 | tr -s ' ' | cut -d ' ' -f 8

grep to pick the drive in question
tr to cleanup the line
cut to extract the value

returns exactly the value of the %b.

Thank you all,
_______________________________________________ mailing list
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to