summaryrefslogtreecommitdiff
path: root/roles/elevate/media/templates/dstat.sh.j2
blob: 236c98889d0c7c18546954a9d29d37b48efc39b3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash

SSD=$(readlink -f {{ install.disks.primary }} | xargs basename)
declare -a ZPOOL_DISKS
{% for disk in zfs_pools.storage.create_vdevs | split | select('ne', 'raidz') %}
ZPOOL_DISKS+=($(readlink -f {{ disk }} | xargs basename))
{% endfor %}

DISKS="$SSD"$(printf ",%s" "${ZPOOL_DISKS[@]}")
if [ -n "$1" ]; then
  DISKS="$DISKS,$1"
fi

exec dstat -cymnd -D "$DISKS" --disk-util