Cosium / zabbix_zfs-on-linux

zabbix template and user parameters to monitor zfs on linux
MIT License
76 stars 50 forks source link

Issue "Get iostats" in ZFS pool discovery #43

Open francescoveroli opened 1 year ago

francescoveroli commented 1 year ago

Hello, i am using:

target Server= Ubuntu 20.04

version of zfs installed:  2.1.4-0ubuntu0.1
srcversion:     E308D3FB5CF298B22C93CCC
vermagic:       5.15.0-1026-aws SMP mod_unload modversions aarch64

zabbix_server (Zabbix) 5.4.12 zabbix_agentd (daemon) (Zabbix) 4.0.17

the item Zpool {#POOLNAME}: Get iostats in ZFS discovery pool value should be changed from vfs.file.contents[/proc/spl/kstat/zfs/{#POOLNAME}/io]

to

vfs.file.contents[/proc/spl/kstat/zfs/{#POOLNAME}/iostats]

once i change it i am getting this error: image

i can't modify the file manually as is autogenereted from the kernel.

i have tryed this too: vfs.file.regexp[/proc/spl/kstat/zfs/rpool/iostats,"^[0-9]"]

it makes switch off the agent getting this error: Screenshot 2023-05-24 at 13 04 53

any help?

thanks

stevleibelt commented 1 year ago

Than we should change to content of the template and replace io with iostats. I had a look, it is the same on my machines (arch linux with zfs). Maybe zfs once changed it from io to iostats?

Since it is your created issue @francescoveroli, would you like to create a change request?

francescoveroli commented 1 year ago

Than we should change to content of the template and replace io with iostats. I had a look, it is the same on my machines (arch linux with zfs). Maybe zfs once changed it from io to iostats?

Since it is your created issue @francescoveroli, would you like to create a change request?

Thanks @stevleibelt for your quick replay. I will wait before the change request as the issue still on going, ill be happy to commit it once is fixed ;)

this is the format of my file iostats:

25 1 0x01 18 4896 5522661940 12146491108198623
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

at the path /proc/spl/kstat/zfs/<pool_name>/iostat

and the conf of my item prototypes:

Screenshot 2023-05-26 at 11 44 53

and so the preprocessing process:

Screenshot 2023-05-26 at 11 45 14

and im still facing the same issue: image

Screenshot 2023-05-26 at 12 42 10

what should i expect?

Thanks in advance

stevleibelt commented 1 year ago

@francescoveroli

I must admit, I have no idea what to expect. Once upon a time, I had a local Zabbix, than things happened and since than, I had no time to get it back online. Or in short, I am currently not using this code here.

Maybe @AceSlash knows the answer? It looks like he is the one contributed most of this project code base.

tuxick commented 12 months ago

I'm now testing using zpool iostat:

UserParameter=zfs.zpool.iostat[*],/sbin/zpool iostat -Hp $1

And then a master item: name: 'ZFS get zpool iostat for {#POOLNAME}' key: 'zfs.zpool.iostat[{#POOLNAME}]' trends: '0' value_type: TEXT applications:

              name: ZFS
            -
              name: 'ZFS zpool'
         preprocessing:
            -
              type: REGEX
              parameters:
                - '[^ ]*\s+[0-9]*\s+[0-9]*\s+([0-9]*)\s+([0-9]*)\s+([0-9]*)\s+([0-9]*)'
                - '[\1, \2, \3, \4]'

and

          name: 'ZFS zpool write ops for {#POOLNAME}'
          type: DEPENDENT
          key: 'zfs.zpool.ops.write[ {#POOLNAME}]'
          delay: '0'
          applications:
            -
              name: ZFS
            -
              name: 'ZFS zpool'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - '$[1]'
          master_item:
            key: 'zfs.zpool.iostat[{#POOLNAME}]'

etc