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

Documentation for state and status values #5

Open
twatzl opened this issue Jul 24, 2019 · 5 comments
Open

Documentation for state and status values #5

twatzl opened this issue Jul 24, 2019 · 5 comments

Comments

@twatzl
Copy link

twatzl commented Jul 24, 2019

Hello,

first of all thanks for your awesome work, but I wonder where I can find the mapping between the integers of zpool state, status etc. and what they actually mean.

I found some prometheus description in the source code, but cannot really find it within prometheus.

Best

@ncabatoff
Copy link
Owner

Hi @twatzl,

They're defined in go-libzfs. Note that given something like

const (
	PoolStatusCorruptCache      PoolStatus = iota /* corrupt /kernel/drv/zpool.cache */
	PoolStatusMissingDevR                         /* missing device with replicas */
	PoolStatusMissingDevNr                        /* missing device with no replicas */

then PoolStatusCorruptCache==0, PoolStatusMissingDevR==1, etc.

@twatzl
Copy link
Author

twatzl commented Jul 31, 2019

Ah thanks. I already looked there but in the wrong place obviously.

So status 27 should be "ok". Is that correct? And there are 28 states in total?

I am just wondering, because then according to this my pool would be resilvering. So either I did a mistake in the mapping or I am misinterpreting the output of zpool status

image

image

(Resilvering is Status 24)

BTW you have a typo in PoolStatusHosidActive (missing t)

@ncabatoff
Copy link
Owner

Sorry, my mistake. I linked you to the current docs for go-libzfs, but I'm not using the current version. 24 is ok, as you note. You can see the old version I'm using here. This exporter is overdue for some love, but I'm afraid I've largely stopped using ZFS, so I'm not sure when that might happen, if ever.

(It's not my typo, I'm not a maintainer of go-libzfs, just a user.)

@oscarbidabehere
Copy link

@twatzl It looks like you edited the default zfs dashboard https://grafana.com/grafana/dashboards/328 and mapped the status values to text. Do you mind sharing your json file? I don't have experiencie with grafana to do it myself. Thanks!

@twatzl
Copy link
Author

twatzl commented Nov 10, 2019

Basically you only need to create a table and choose the correct visualization. Then unfortunately you have to enter all 23 values by hand, but this is how you display it.

I try to write a more detailed blog post soon(tm), but i have much to do at the moment.

Since this is deviating from the original issue you might want to open a new one and link it here if you have more questions.

image

image

Best!

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

3 participants