This afternoon I was checking out my thin pool statistics when I noticed one of the pools had a significantly higher allocation usage than I was expecting. I started digging into my documentation (I track every device created in a postgres database for tracking and trending) to see if a whole lot of devices we created over the weekend – and none were. I started looking for an easy way to find bound luns that are not in a storage group – nothing! I started to write my own shell script and the next thing you know I ended up with an inventory Perl script which tracks every meta device including lun id, thin pool, storage group, total thin allocation in Gb, and the FA ports they are bound to.
It’s simple enough to get with SMC but that is a lot of clicking. So here it is!
[box] ./inventory.pl lun_id,size,thin_pool,gb_alloc,%_alloc,gb_written,%_written,sg,FAs
The output is CSV. You can download the code here:
[box]An of course a small disclaimer. This script works for me in my environment. Do your homework and make this work for you. While I have tried to make this robust and fully functional, it’s important to note “stuff happens”, this is provided “as is” with no warranty whatsoever. Use at your own risk and all that jazz.[/box]