Skip to content

Conversation

@MrNinso
Copy link

@MrNinso MrNinso commented Dec 17, 2021

Update template format to yaml and fix /proc/spl/kstat/zfs/{#POOLNAME}/io Not found

closes #33

@MrNinso MrNinso changed the title Fix Pool IOPS and Pool throughput itens WIP: Fix Pool IOPS and Pool throughput itens Dec 17, 2021
@MrNinso MrNinso changed the title WIP: Fix Pool IOPS and Pool throughput itens Fix Pool IOPS and Pool throughput itens Dec 17, 2021
UserParameter=zfs.pool.discovery,/usr/bin/sudo /sbin/zpool list -H -o name | sed -e '$ ! s/\(.*\)/{"{#POOLNAME}":"\1"},/' | sed -e '$ s/\(.*\)/{"{#POOLNAME}":"\1"}]}/' | sed -e '1 s/\(.*\)/{ \"data\":[\1/'

# pool IOPS read
UserParameter=zfs.zpool.iostat.reads[*],/usr/bin/sudo /sbin/zpool iostat $1 -H -p 1 2 | sed 's/\t/-/g' | cut -d '-' -f 4 | tail -n 1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the same command multiple times just to extract different fields from the output is both extremely inefficient and has potential inconsistency problems.

It would be much better to run the command once and then use dependent items to just parse the output multiple times instead of running the command multiple times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot obtain file /proc/spl/kstat/zfs/test/io

2 participants