Adam - ZFS Pool Monitoring

New About Yours API Help
1.6 KB, HTML + Django/Jinja template

I don't know if this is useful at all, but I've recently started using Ansible to gather information on my ZFS setup.

Some kind soul has written a module for Ansible to cover a lot of the ZFS stuff, meaning detailed output can be gathered with as few lines as the below:



- name: "Gather ZFS dataset data facts"
    dataset: data

- name: Report space usage on ZFS filesystems under data
    name: data
    recurse: yes
    type: filesystem

- debug:
    msg: 'ZFS dataset {{ }} consumes {{ item.used }} of disk space.'
  with_items: '{{ ansible_zfs_datasets }}'


This is detailed very well on the Ansible pages:

There are also zpool options:


- name: Gather ZFS Pool Facts
    pool: zroot

- name: Gather space usage for all pools
    properties: 'free,size'

- name: Print gathered facts on size
    msg: 'ZFS pool {{ }} has {{ }} free space out of {{ item.size }}.'
  with_items: '{{ ansible_zfs_pools }}'


While not realtime monitoring, I find this very useful, and someone clearly had a desire at some point in the past for this functionality, as it's baked into Ansible.

Results look similar to: 

ok: [] => (item={u'name': u'data', u'free': u'675G', u'size': u'928G'}) => {
    "item": {
        "free": "675G", 
        "name": "data", 
        "size": "928G"
    "msg": "ZFS pool data has 675G free space out of 928G."
Pasted 5 months, 1 week ago — Expires in 208 days