Resource icon

zpool output unification with converting GPTID to GEOM name

if you have zpool commands (iostat, status) output with mix of GPTID and GEOM name, it's not so easy to read. Small script below (fixer.sh) will convert GPTID to GEOM name in zpool output piping:


zpool iostat -v | ./fixer.sh


Code:
#!/bin/sh
# to change GPTID to GEOM name in zpool commands by turvas@gmail.com
# usage with zpool output procssing : zpool iostat -v | ./fixer.sh
glabel status | awk '{print "s|"$1"|"$3"\t\t\t	  |g"}' > glabel-lookup.sed
sed -f glabel-lookup.sed
rm glabel-lookup.sed
Author
turvas
Views
1,436
First release
Last update
Rating
5.00 star(s) 3 ratings

Latest reviews

Much easier to read! But it doesn't seem to format properl with a l2arc cache at the bottom?

capacity operations bandwidth
pool alloc free read write read write
-------------------------------------- ----- ----- ----- ----- ----- -----
ESXi 7.27T 32.6T 540 11.7K 20.1M 198M
mirror 684G 2.96T 45 776 1.54M 11.8M
da2p2 - - 25 243 750K 11.7M
da3p2 - - 19 242 830K 11.7M
mirror 674G 2.97T 42 831 1.56M 12.7M
da6p2 - - 21 254 837K 12.4M
da7p2 - - 20 257 758K 12.6M
mirror 675G 2.97T 59 666 2.02M 11.7M
da10p2 - - 28 185 1.02M 11.7M
da11p2 - - 30 180 1.00M 11.7M
mirror 681G 2.96T 57 804 2.15M 14.5M
da14p2 - - 27 171 1.14M 14.4M
da15p2 - - 29 173 1.01M 14.2M
mirror 680G 2.96T 59 642 2.50M 9.71M
da18p2 - - 29 182 1.25M 9.71M
da19p2 - - 29 180 1.25M 9.71M
mirror 680G 2.96T 50 761 2.21M 15.0M
da22p2 - - 24 176 1.20M 15.0M
da23p2 - - 25 174 1.01M 15.0M
mirror 672G 2.97T 61 881 2.44M 11.8M
da4p2 - - 25 220 941K 11.8M
da5p2 - - 34 229 1.52M 11.8M
mirror 682G 2.96T 44 891 1.67M 11.7M
da12p2 - - 29 224 1.15M 11.7M
da13p2 - - 14 218 542K 11.8M
mirror 682G 2.96T 28 1.07K 1.07M 14.9M
da20p2 - - 12 264 502K 14.9M
da21p2 - - 15 260 598K 14.8M
mirror 668G 2.97T 43 975 1.39M 15.7M
da8p2 - - 22 277 646K 15.6M
da9p2 - - 20 280 774K 15.6M
mirror 667G 2.97T 43 888 1.52M 13.4M
da0p2 - - 22 291 837K 13.2M
da1p2 - - 20 281 718K 13.5M
logs - - - - - -
mirror 84.0M 76.9G 0 2.65K 0 54.9M
nvd0p2 - - 0 2.65K 0 54.9M
nvd1p2 - - 0 2.65K 0 54.9M
cache - - - - - -
nvd2p1 441G 24.9G 86 15 2.90M 878K
-------------------------------------- ----- ----- ----- ----- ----- -----
Very useful tool to keep handy. It's one of those things that you'll find yourself grabbing every now and then.
Took the time to share tools for everyone! Well done!
Top