Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Pool IOPS and Pool throughput itens #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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
# pool discovery
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