Cosium / zabbix_zfs-on-linux

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

a zpool is also a dataset #23

Closed victor-sudakov closed 3 years ago

victor-sudakov commented 3 years ago

This template differentiates a zpool from a zfs dataset by the presence of "/" in the name, is this correct?

I happen to have some hosts where the zpool itself is the only dataset, like here:

# zpool list
NAME    SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
users   472G   147G   325G        -         -    13%    31%  1.00x    ONLINE  -
# zfs list
NAME    USED  AVAIL     REFER  MOUNTPOINT
users   147G   311G      147G  /users
# 

Thus I'm missing useful statistics (e.g. compression ratio) about the dataset "users" because the template does not recognize "users" as a rightful dataset.

Is there a way to circumvent this other than create children datasets in the pool and move all data thereto (I would hate this)?

AceSlash commented 3 years ago

Interesting case, I never thought of that. This make a case to simply drop the regex and consider the first dataset like any other datasets.

This would also simplify the installation of the template, I think I'll just do that.

victor-sudakov commented 3 years ago

Interesting case, I never thought of that. This make a case to simply drop the regex and consider the first dataset like any other datasets.

This would also simplify the installation of the template, I think I'll just do that.

It will probably break the detection of zpools? Doesn't the detection of zpools also rely on this regex?

AceSlash commented 3 years ago

Nope, the zpool LLD is based on zpool list so that's completely unrelated, this will also solve #22 since the expression will no longer be necessary.

victor-sudakov commented 3 years ago

Nope, the zpool LLD is based on zpool list so that's completely unrelated, this will also solve #22 since the expression will no longer be necessary.

So, is it safe to remove those 2 filters from my production Zabbix system? And my top-level datasets like /users and /d01 will start being monitored?

AceSlash commented 3 years ago

@victor-sudakov : import the latest version of the template first, then you can remove the global expression. You should see at the next discovery cycle your "base" dataset.

victor-sudakov commented 3 years ago

@victor-sudakov : import the latest version of the template first, then you can remove the global expression. You should see at the next discovery cycle your "base" dataset.

It works! Thanks.

Looking at git diff 12eecbf..ffc0105 though, I could have simply deleted the filters without updating the template.