annotate files/zfs_metrics/zfs_space_metrics.sh @ 168:e18d1a8b1523

start making linux users per service
author drewp@bigasterisk.com
date Tue, 21 Mar 2023 00:09:07 -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}