fix(inputs.zfs): Unbreak datasets stats gathering in case listsnaps is enabled on a zfs pool (#12307)

This commit is contained in:
Boris Lytochkin 2022-12-06 00:01:59 +03:00 committed by GitHub
parent 70b33c2649
commit 41c9af5bb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 1 additions and 9 deletions

View File

@ -7809,8 +7809,6 @@
# # poolMetrics = false # # poolMetrics = false
# #
# ## By default, don't gather dataset stats # ## By default, don't gather dataset stats
# ## On FreeBSD, if the user has enabled listsnapshots in the pool property,
# ## telegraf may not be able to correctly parse the output.
# # datasetMetrics = false # # datasetMetrics = false

View File

@ -7705,8 +7705,6 @@
# # poolMetrics = false # # poolMetrics = false
# #
# ## By default, don't gather dataset stats # ## By default, don't gather dataset stats
# ## On FreeBSD, if the user has enabled listsnapshots in the pool property,
# ## telegraf may not be able to correctly parse the output.
# # datasetMetrics = false # # datasetMetrics = false

View File

@ -34,8 +34,6 @@ See the [CONFIGURATION.md][CONFIGURATION.md] for more details.
# poolMetrics = false # poolMetrics = false
## By default, don't gather dataset stats ## By default, don't gather dataset stats
## On FreeBSD, if the user has enabled listsnapshots in the pool property,
## telegraf may not be able to correctly parse the output.
# datasetMetrics = false # datasetMetrics = false
``` ```

View File

@ -16,6 +16,4 @@
# poolMetrics = false # poolMetrics = false
## By default, don't gather dataset stats ## By default, don't gather dataset stats
## On FreeBSD, if the user has enabled listsnapshots in the pool property,
## telegraf may not be able to correctly parse the output.
# datasetMetrics = false # datasetMetrics = false

View File

@ -187,7 +187,7 @@ func zpool() ([]string, error) {
} }
func zdataset(properties []string) ([]string, error) { func zdataset(properties []string) ([]string, error) {
return run("zfs", []string{"list", "-Hp", "-o", strings.Join(properties, ",")}...) return run("zfs", []string{"list", "-Hp", "-t", "filesystem,volume", "-o", strings.Join(properties, ",")}...)
} }
func sysctl(metric string) ([]string, error) { func sysctl(metric string) ([]string, error) {