annotate files/zfs_metrics/zfs_space_metrics.sh @ 137:2acb7a80d92d

fix pointless 10.1 destination
author drewp@bigasterisk.com
date Wed, 21 Dec 2022 17:45:05 -0800
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}