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

IO stats can't be read #10

Open
RomLecat opened this issue Jan 17, 2022 · 3 comments
Open

IO stats can't be read #10

RomLecat opened this issue Jan 17, 2022 · 3 comments

Comments

@RomLecat
Copy link

RomLecat commented Jan 17, 2022

Hello,

The script can't seem to export IO stats properly.
Zabbix reports "Failed: cannot extract value from json by path "$.pools['tank'].io.nread": no data matches the specified path".

[root@nas scripts]# zfs version
zfs-2.1.2-1
zfs-kmod-2.1.2-1
[root@nas scripts]# cat /proc/spl/kstat/zfs/tank/iostats
25 1 0x01 18 4896 16480097184 1560546720495438
name                            type data
trim_extents_written            4    0
trim_bytes_written              4    0
trim_extents_skipped            4    0
trim_bytes_skipped              4    0
trim_extents_failed             4    0
trim_bytes_failed               4    0
autotrim_extents_written        4    0
autotrim_bytes_written          4    0
autotrim_extents_skipped        4    0
autotrim_bytes_skipped          4    0
autotrim_extents_failed         4    0
autotrim_bytes_failed           4    0
simple_trim_extents_written     4    0
simple_trim_bytes_written       4    0
simple_trim_extents_skipped     4    0
simple_trim_bytes_skipped       4    0
simple_trim_extents_failed      4    0
simple_trim_bytes_failed        4    0
[root@nas scripts]# zabbix_agent2 -t zfs
...
"pools": {
    "tank": {
      "name": "tank",
      "size": 235965503242240,
      "alloc": 128453681639424,
      "free": 107511821602816,
      "frag": 4,
      "usage": 54,
      "dedup": 1.0,
      "scrub": 0,
      "online": 1,
      "io": {
        "type": 4,
        "data": 0
      }
    }
  }
... 

Likely due to openzfs/zfs@371f88d

Thanks :)

@blind-oracle
Copy link
Owner

blind-oracle commented Jan 18, 2022

Hi. Yeah, probably due to that. I'm not sure how to better get those stats, but probably for now we can just remove them so that it does not cause alerts in Zabbix...

@RomLecat
Copy link
Author

RomLecat commented Jan 18, 2022

I'm not sure if there's any other way than parsing the output of zpool iostat right now 😕

For instance, to get the stats of the latest 1 second:

[root@nas ~]# zpool iostat -yp 1 1
                        capacity                         operations                         bandwidth
pool                  alloc             free             read            write             read            write
----------  ---------------  ---------------  ---------------  ---------------  ---------------  ---------------
tank        128466484310016  107499018932224               85                0          4407824                0
[root@nas ~]# zpool iostat -yHp 1 1
tank    128466487062528 107499016179712 183     0       11438520        0

@blind-oracle
Copy link
Owner

Yeah, or summing per-disk IOs of vdevs, which is also not nice.
zpool iostat way I don't like as it blocks the script for one second but I just want cumulative counters...

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

No branches or pull requests

2 participants