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

Collect zfs zfs zpool stats for size / free / health #3464

Closed
krishnaghatti opened this issue Nov 12, 2017 · 8 comments
Closed

Collect zfs zfs zpool stats for size / free / health #3464

krishnaghatti opened this issue Nov 12, 2017 · 8 comments

Comments

@krishnaghatti
Copy link

I am using the zfs input plugin (https://github.com/influxdata/telegraf/tree/master/plugins/inputs/zfs) on ubuntu 16.04 system. I have enabled the zfs_pool metrics in the configuration as blow:
[inputs.zfs] poolMetrics = true
In the readme markdown I see the that the stats such as free, size etc are only available for BSD bsd based systems.
Is there any way I can get the same for linux system?

@danielnelson
Copy link
Contributor

I'm not sure if it is available, the plugin uses procfs for gathering this information and in particular the files matching /proc/spl/kstat/zfs/*/io. Would you be able to send me the contents of one of these files?

@krishnaghatti
Copy link
Author

Below is the out put:

# cat /proc/spl/kstat/zfs/zpool-docker/io 20 3 0x00 1 80 6110017190 1315092523939 nread nwritten reads writes wtime wlentime wupdate rtime rlentime rupdate wcnt rcnt 526387712 896350208 47749 41015 26400350452 4200895256131 1315091395635 39489525805 4200895256131 1315091396091 851 1

There are no details of the zpool health or the size info in that output though.

@danielnelson
Copy link
Contributor

Can you check if it is available in a nearby file?

@krishnaghatti
Copy link
Author

krishnaghatti commented Nov 15, 2017

sorry for the delay in response. not finding the data in any files. only zpool command seems to return the data.

# zpool list
NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
zpool-docker 496G 47.2G 449G - 7% 9% 1.00x ONLINE -

@danielnelson
Copy link
Contributor

Maybe we can examine the source for zpool list to learn how it builds this information. Worse case we could parse the output of this command but it would be more efficient if we can gather the information directly from a file.

@krishnaghatti
Copy link
Author

krishnaghatti commented Nov 19, 2017

it would be more efficient if we can gather the information directly from a file.

I agree.
I will check the command and see if it stores the data in any file.

@danielnelson danielnelson changed the title question regarding zfs zpool stats Collect zfs zfs zpool stats for size / free / health Dec 14, 2017
@danielnelson
Copy link
Contributor

@krishnaghatti I think this is actually the same as #2616, I'm going to close but let me know if that issue does not meet your requirements.

@krishnaghatti
Copy link
Author

@danielnelson Thank you. Yes the requirements in the other ticket are good. I will follow up that case.

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