annotate files/zfs_metrics/zfs_space_metrics.sh @ 189:ef443257ae9c

new host 'squib'
author drewp@bigasterisk.com
date Mon, 12 Jun 2023 13:01:59 -0700
parents 69058ad170be
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
118
69058ad170be watch output from `zfs list -o space` as metrics
drewp@bigasterisk.com
parents:
diff changeset
1 #!/bin/zsh
69058ad170be watch output from `zfs list -o space` as metrics
drewp@bigasterisk.com
parents:
diff changeset
2
69058ad170be watch output from `zfs list -o space` as metrics
drewp@bigasterisk.com
parents:
diff changeset
3 LOG=/tmp/zfs_space_metrics_pipe
69058ad170be watch output from `zfs list -o space` as metrics
drewp@bigasterisk.com
parents:
diff changeset
4 rm -f ${LOG}
69058ad170be watch output from `zfs list -o space` as metrics
drewp@bigasterisk.com
parents:
diff changeset
5 mkfifo ${LOG}
69058ad170be watch output from `zfs list -o space` as metrics
drewp@bigasterisk.com
parents:
diff changeset
6
69058ad170be watch output from `zfs list -o space` as metrics
drewp@bigasterisk.com
parents:
diff changeset
7 while (true) {
69058ad170be watch output from `zfs list -o space` as metrics
drewp@bigasterisk.com
parents:
diff changeset
8 zfs list -Hp -o space
69058ad170be watch output from `zfs list -o space` as metrics
drewp@bigasterisk.com
parents:
diff changeset
9 sleep 1m
69058ad170be watch output from `zfs list -o space` as metrics
drewp@bigasterisk.com
parents:
diff changeset
10 } > ${LOG} &
69058ad170be watch output from `zfs list -o space` as metrics
drewp@bigasterisk.com
parents:
diff changeset
11
69058ad170be watch output from `zfs list -o space` as metrics
drewp@bigasterisk.com
parents:
diff changeset
12 mtail -logtostderr -progs /opt/zfs_metrics/ -port 9985 -logs ${LOG}