Skip to content

Commit

Permalink
Match only first device if multiple
Browse files Browse the repository at this point in the history
Match only the first return if multiple devices match
  • Loading branch information
tweiers authored Nov 16, 2022
1 parent 64cbc08 commit 0fd1236
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ UserParameter=zfs.arcstats[*],awk '/^$1/ {printf $$3;}' /proc/spl/kstat/zfs/arcs
UserParameter=zfs.zpool.scrub[*],/usr/bin/sudo /sbin/zpool status $1 | grep "scrub in progress" > /dev/null ; echo $?

# vdev state
UserParameter=zfs.vdev.state[*],/usr/bin/sudo /sbin/zpool status | grep "$1" | awk '{ print $$2 }'
UserParameter=zfs.vdev.state[*],/usr/bin/sudo /sbin/zpool status | grep -m 1 "$1" | awk '{ print $$2 }'
# vdev READ error counter
UserParameter=zfs.vdev.error_counter.read[*],/usr/bin/sudo /sbin/zpool status | grep "$1" | awk '{ print $$3 }' | numfmt --from=si
UserParameter=zfs.vdev.error_counter.read[*],/usr/bin/sudo /sbin/zpool status | grep -m 1 "$1" | awk '{ print $$3 }' | numfmt --from=si
# vdev WRITE error counter
UserParameter=zfs.vdev.error_counter.write[*],/usr/bin/sudo /sbin/zpool status | grep "$1" | awk '{ print $$4 }' | numfmt --from=si
UserParameter=zfs.vdev.error_counter.write[*],/usr/bin/sudo /sbin/zpool status | grep -m 1 "$1" | awk '{ print $$4 }' | numfmt --from=si
# vdev CHECKSUM error counter
UserParameter=zfs.vdev.error_counter.cksum[*],/usr/bin/sudo /sbin/zpool status | grep "$1" | awk '{ print $$5 }' | numfmt --from=si
UserParameter=zfs.vdev.error_counter.cksum[*],/usr/bin/sudo /sbin/zpool status | grep -m 1 "$1" | awk '{ print $$5 }' | numfmt --from=si

# Get zpool iostats
UserParameter=zfs.zpool.iostat[*],/usr/bin/sudo /sbin/zpool iostat $1 -H -p 1 2 | tail -n 1
UserParameter=zfs.zpool.iostat[*],/usr/bin/sudo /sbin/zpool iostat $1 -H -p 1 2 | tail -n 1

0 comments on commit 0fd1236

Please sign in to comment.