getting iostat -x %b with php

pobox at verysmall.org pobox at verysmall.org
Mon Apr 21 10:53:26 UTC 2008


I am trying to add performance monitor to a php application working on a 
dedicated server and one of the informations I would like to collect is 
the hard drives load, which, as far as I could find out, can be seen in 
the %b of iostat -x.

What would be the most reliable way to extract this information with 
php? I could imagine that I can exec() the iostat -x - but I am not sure 
about the best way to parse the iostst -x output, so that I get exactly 
this number. For instance, can I rely that %b is aways the Nth column in 
the answer? - then I could do it with regex.

Iv


More information about the freebsd-questions mailing list