![1 Star 1 Star](https://i0.wp.com/www.devtech101.com/wp-content/plugins/wp-postratings/images/stars_crystal/rating_off.gif?w=1200&ssl=1)
![2 Stars 2 Stars](https://i0.wp.com/www.devtech101.com/wp-content/plugins/wp-postratings/images/stars_crystal/rating_off.gif?w=1200&ssl=1)
![3 Stars 3 Stars](https://i0.wp.com/www.devtech101.com/wp-content/plugins/wp-postratings/images/stars_crystal/rating_off.gif?w=1200&ssl=1)
![4 Stars 4 Stars](https://i0.wp.com/www.devtech101.com/wp-content/plugins/wp-postratings/images/stars_crystal/rating_off.gif?w=1200&ssl=1)
![5 Stars 5 Stars](https://i0.wp.com/www.devtech101.com/wp-content/plugins/wp-postratings/images/stars_crystal/rating_off.gif?w=1200&ssl=1)
![](https://i0.wp.com/www.devtech101.com/wp-content/plugins/wp-postratings/images/loading.gif?resize=16%2C16&ssl=1)
The below Example captures IOStat output with Python in Solaris
#!/bin/python
import subprocess
import csv
io_c = subprocess.Popen(['iostat', '-xnsMr', '1', '2'], stdout=subprocess.PIPE, shell=False, stderr=subprocess.PIPE)
stdout = io_c.communicate()[0]
lc = len(stdout.split('\n'))
it_lc = lc / 2 + 2
reader = csv.reader(stdout.split('\n')[it_lc:], delimiter=',')
for row in reader:
if any(row):
#print row
print row[0],row[1],row[2],row[3],row[7],row[8],row[9],row[10]
Output should look similar to the below.
0.0 0.0 0.0 0.0 0.0 0 0 c3t3d0
0.0 0.0 0.0 0.0 0.0 0 0 c3t0d0
0.0 0.0 0.0 0.0 0.0 0 0 c3t1d0
0.0 0.0 0.0 0.0 0.0 0 0 c3t2d0
0.0 0.0 0.0 0.0 0.0 0 0 nas-srv:/export/sys-admin/unix
0.0 0.0 0.0 0.0 0.0 0 0 10.10.10.11:/export/shares
0
0
votes
Article Rating
Hi Eli, have you extended this since 2016?
Hi, and welcome to my Blog.
No, I have not used this in a while, but if you are in the latest versions of Solaris, I believe from 11.4+, you can try using Analytics which is much nicer.
For a custom approach, I have a series of articles written up, part 1 is here. – http://devtech101.com/2016/08/31/capturing-solaris-11-4-12-analytics-sstore-part-1/