Skip to content

Commit

Permalink
fix #26 : use "numfmt --from=si" to parse zpool status (#28)
Browse files Browse the repository at this point in the history
Co-authored-by: Jeremie Grauer <[email protected]>
  • Loading branch information
AceSlash and Jeremie Grauer authored Feb 8, 2021
1 parent 8ce12e3 commit c0e9b09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions userparameters/ZoL_with_sudo.conf
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ UserParameter=zfs.zpool.scrub[*],/usr/bin/sudo /sbin/zpool status $1 | grep "scr
# vdev state
UserParameter=zfs.vdev.state[*],/usr/bin/sudo /sbin/zpool status | grep "$1" | awk '{ print $$2 }'
# vdev READ error counter
UserParameter=zfs.vdev.error_counter.read[*],/usr/bin/sudo /sbin/zpool status -p | grep "$1" | awk '{ print $$3 }'
UserParameter=zfs.vdev.error_counter.read[*],/usr/bin/sudo /sbin/zpool status | grep "$1" | awk '{ print $$3 }' | numfmt --from=si
# vdev WRITE error counter
UserParameter=zfs.vdev.error_counter.write[*],/usr/bin/sudo /sbin/zpool status -p | grep "$1" | awk '{ print $$4 }'
UserParameter=zfs.vdev.error_counter.write[*],/usr/bin/sudo /sbin/zpool status | grep "$1" | awk '{ print $$4 }' | numfmt --from=si
# vdev CHECKSUM error counter
UserParameter=zfs.vdev.error_counter.cksum[*],/usr/bin/sudo /sbin/zpool status -p | grep "$1" | awk '{ print $$5 }'
UserParameter=zfs.vdev.error_counter.cksum[*],/usr/bin/sudo /sbin/zpool status | grep "$1" | awk '{ print $$5 }' | numfmt --from=si
6 changes: 3 additions & 3 deletions userparameters/ZoL_without_sudo.conf
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ UserParameter=zfs.zpool.scrub[*],/sbin/zpool status $1 | grep "scrub in progress
# vdev state
UserParameter=zfs.vdev.state[*],/sbin/zpool status | grep "$1" | awk '{ print $$2 }'
# vdev READ error counter
UserParameter=zfs.vdev.error_counter.read[*],/sbin/zpool status -p | grep "$1" | awk '{ print $$3 }'
UserParameter=zfs.vdev.error_counter.read[*],/sbin/zpool status | grep "$1" | awk '{ print $$3 }' | numfmt --from=si
# vdev WRITE error counter
UserParameter=zfs.vdev.error_counter.write[*],/sbin/zpool status -p | grep "$1" | awk '{ print $$4 }'
UserParameter=zfs.vdev.error_counter.write[*],/sbin/zpool status | grep "$1" | awk '{ print $$4 }' | numfmt --from=si
# vdev CHECKSUM error counter
UserParameter=zfs.vdev.error_counter.cksum[*],/sbin/zpool status -p | grep "$1" | awk '{ print $$5 }'
UserParameter=zfs.vdev.error_counter.cksum[*],/sbin/zpool status | grep "$1" | awk '{ print $$5 }' | numfmt --from=si

0 comments on commit c0e9b09

Please sign in to comment.