ohai
ohai copied to clipboard
zpool plugin should include topology/vdev details
Currently the plugin only includes information on device ids and the numbers that zpool status
kindly provides. This are several reasonable questions that this is not sufficient to answer:
- Are there spares left?
- Is a cache or seperate log device available for performance?
- Is there redundant storage? How many disks can fail before data is lost?
I think sucking in the topology information from zpool status
would be sufficient to answer all of these questions. I suspect the most straightforward thing to do would be to map the pretty printed tree into Hashes but I admit that parsing the amount of whitespace sounds unfun.
Example output:
# zpool status
pool: tank
state: ONLINE
scan: none requested
config:
NAME STATE READ WRITE CKSUM
tank ONLINE 0 0 0
mirror-0 ONLINE 0 0 0
ata-foo_bar-part4 ONLINE 0 0 0
ata-foo_bar-part4 ONLINE 0 0 0
mirror-1 ONLINE 0 0 0
ata-foo_bar ONLINE 0 0 0
ata-foo_bar ONLINE 0 0 0
cache
ata-foo_bar ONLINE 0 0 0
If that information comes from a file in /proc we should probably get it out of there first.
I'm looking at parsing a bit more information out of the zpool status, but the output is pretty awful and only Linux contains flags to distinguish between drives and pools. It's kind of a bummer, but we can probably rely on the spacing to determine what type of data we're looking at