Nicolas Dorfsman
2008-Feb-01 15:17 UTC
[zfs-discuss] Computer usable output for zpool commands
Hi, I wrote an hobbit script around lunmap/hbamap commands to monitor SAN health. I''d like to add detail on what is being hosted by those luns. With svm metastat -p is helpful. With zfs, zpool status output is awful for script. Is there somewhere an utility to show zpool informations in a scriptable format ? Nico This message posted from opensolaris.org
eric kustarz
2008-Feb-12 19:33 UTC
[zfs-discuss] Computer usable output for zpool commands
On Feb 1, 2008, at 7:17 AM, Nicolas Dorfsman wrote:> Hi, > > I wrote an hobbit script around lunmap/hbamap commands to monitor > SAN health. > I''d like to add detail on what is being hosted by those luns. > > With svm metastat -p is helpful. > > With zfs, zpool status output is awful for script. > > Is there somewhere an utility to show zpool informations in a > scriptable format ?What exactly do you want to display? We have the ''-H'' option to ''zfs list'' and ''zfs get'' for parsing. Feel free to experiment with the code to make zpool otuput more scriptable: http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/ zpool/zpool_main.c eric
Robert Milkowski
2008-Feb-20 22:16 UTC
[zfs-discuss] Computer usable output for zpool commands
Hello eric, Tuesday, February 12, 2008, 7:33:14 PM, you wrote: ek> On Feb 1, 2008, at 7:17 AM, Nicolas Dorfsman wrote:>> Hi, >> >> I wrote an hobbit script around lunmap/hbamap commands to monitor >> SAN health. >> I''d like to add detail on what is being hosted by those luns. >> >> With svm metastat -p is helpful. >> >> With zfs, zpool status output is awful for script. >> >> Is there somewhere an utility to show zpool informations in a >> scriptable format ?ek> What exactly do you want to display? ek> We have the ''-H'' option to ''zfs list'' and ''zfs get'' for parsing. ek> Feel free to experiment with the code to make zpool otuput more ek> scriptable: ek> http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/ ek> zpool/zpool_main.c Eric - IIRC in early zfs days you could actually get zpool output describing your pool (not zfs datasets but pool itself) in a way which is easy to re-create it. If you have couple of dozen disks with some N-raidz2 config and you just happen to buy another unit and lost your zpool create command but still want to create it exactly the same as on previous one, zpool output doesn''t help you in current bits with it. Getting output where you just can do something like zpool create test `zpool status -S current` could bu useful (of course above command doesn''t make sens but you get the idea). -- Best regards, Robert Milkowski mailto:milek at task.gda.pl http://milek.blogspot.com
eric kustarz
2008-Feb-20 23:32 UTC
[zfs-discuss] Computer usable output for zpool commands
On Feb 20, 2008, at 2:16 PM, Robert Milkowski wrote:> Hello eric, > > Tuesday, February 12, 2008, 7:33:14 PM, you wrote: > > ek> On Feb 1, 2008, at 7:17 AM, Nicolas Dorfsman wrote: > >>> Hi, >>> >>> I wrote an hobbit script around lunmap/hbamap commands to monitor >>> SAN health. >>> I''d like to add detail on what is being hosted by those luns. >>> >>> With svm metastat -p is helpful. >>> >>> With zfs, zpool status output is awful for script. >>> >>> Is there somewhere an utility to show zpool informations in a >>> scriptable format ? > > ek> What exactly do you want to display? > > ek> We have the ''-H'' option to ''zfs list'' and ''zfs get'' for parsing. > ek> Feel free to experiment with the code to make zpool otuput more > ek> scriptable: > ek> http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/ > ek> zpool/zpool_main.c > > > Eric - IIRC in early zfs days you could actually get zpool output > describing your pool (not zfs datasets but pool itself) in a way which > is easy to re-create it. > > If you have couple of dozen disks with some N-raidz2 config and you > just happen to buy another unit and lost your zpool create command but > still want to create it exactly the same as on previous one, zpool > output doesn''t help you in current bits with it. > > Getting output where you just can do something like > > zpool create test `zpool status -S current` > > could bu useful (of course above command doesn''t make sens but you get > the idea).You can always retrieve the original ''zpool create'' command via ''zpool history'' as it is never overwritten. However, if you later on do a ''zpool add'' that can potentially be overwritten (as the history is implemented as a ring buffer). eric