node-exporter-textfile-collector-scripts icon indicating copy to clipboard operation
node-exporter-textfile-collector-scripts copied to clipboard

Add zfs_zpool.sh script

Open candlerb opened this issue 5 years ago • 1 comments

Useful for monitoring zpool health, zvolumes, and zfs filesystems which are not mounted

Also zfs-specific stats which can't be seen from node_filesystem metrics (e.g. compressratio)

candlerb avatar Dec 13 '19 14:12 candlerb

For whatever it is worth, I use this to track the age of the latest snapshot:

        zfs list -Hp -t snapshot -o name,creation \
          | sed -e 's#@.*\s# #' \
          | awk '
              {
                if (last[$1] < $2) {
                  last[$1]=$2
                }
              }
              END {
                for (m in last) {
                  printf "zfs_snapshot_age_seconds{dataset=\"%s\"} %s\n", m, last[m];
                }
              }
            ' \
          | sponge znapzend-snaps.prom

grahamc avatar Jan 30 '20 03:01 grahamc