ZFSviz 0.0001

So … this is a first version of the ZFSviz script. Sorry for my bad coding style, but i’m not a developer. Didn’t knew my perl knowledge was that rusty …. To execute this script you need two things not available on a plain vanilla Solaris system. You need the Tree::Simple library (perl -MCPAN -e 'install Tree::Simple' should do the trick) and an installation of GraphViz on a system. The perl library has to be installed on every system you want to use the script. The GraphViz software is just needed on the system you want to use to render the output of the ZFSviz script. GraphViz is available at sunfreeware.com, at blastwave.com or at opencsw.org. Okay. After copying this script (obviously you have to strip the .txt and chmod the file) to you system, you need to assume a role or a user that is capable to execute zfs get and zfs list (root will do the trick). This version of the script won’t work on Solaris 10. You have to modify a line. You must substitute $zfslist_command = "zfs list -H -t all -o name,origin,type"; with $zfslist_command = "zfs list -H -o name,origin,type";. I’ve implemented two modes of operation. The first one is the basic mode. You can use it with zfsviz.pl -m basic. It’s a simple overview of the ZFS datasets. A blue ellipse is a snapshot, a green hexagon a volume and a black rectangle a filesystem. A red arrow is a cloning dependency.


(click on image for larger version)

The verbose mode yields an overview with more data, but you need a much larger display or printer ;) It prints some additional information about each node. In this version, it’s just the creation time but at the end this script is already capable to deliver all informations available by zfs get all. So a zfsviz.pl -m verbose should yield something like this:


(click on image for larger version)

The color coding is the same as with the basic output. But the ZFS objects are presented in a different way to display the properties of a file system. The script doesn’t render the images at it own. It uses GraphViz for this task. After executing the zfsviz.pl script, you will yield a file out.dot. The name of the file is hardcoded at the moment. You have to feed it to your GraphViz installation with dot -Tpng out.dot -o out.png. This will provide you the nice graphics. Hope that this script is of help for you :)