-
Notifications
You must be signed in to change notification settings - Fork 453
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
Update zpools plugin to work on Linux/BSD #1001
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Tim Smith <tsmith@chef.io>
Signed-off-by: Tim Smith <tsmith@chef.io>
We need Linux specs still Signed-off-by: Tim Smith <tsmith@chef.io>
Signed-off-by: Tim Smith <tsmith@chef.io>
{
"storage": {
"pool_size": "7.25T",
"pool_allocated": "1.20M",
"pool_free": "7.25T",
"capacity_used": "0%",
"dedup_factor": "1.00x",
"health": "ONLINE",
"zpool_version": null,
"devices": {
"sda": {
"state": "ONLINE",
"errors": {
"read": "0",
"write": "0",
"checksum": "0"
}
},
"sdb": {
"state": "ONLINE",
"errors": {
"read": "0",
"write": "0",
"checksum": "0"
}
},
"sde": {
"state": "ONLINE",
"errors": {
"read": "0",
"write": "0",
"checksum": "0"
}
},
"sdf": {
"state": "ONLINE",
"errors": {
"read": "0",
"write": "0",
"checksum": "0"
}
}
}
}
} |
Signed-off-by: Tim Smith <tsmith@chef.io>
coderanger
approved these changes
Jun 1, 2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seem correct from my limited knowledge.
I'm merging this and I'm going to continue to gather zpool status example outputs to see if we can just rely on the spacing. If so we can eliminate the longstanding bugs and some of the awfulness of this regex. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This plugin works on Linux/BSD for the most part. Let's do the extra work to get there.
Caveats:
The regex is still less than ideal here. Since zpool status for a zpool lists the zlevel and the volume itself along with the drives it's a bit tricky to extract just the drive information. We're relying on the starting characters to identify drives. So we're saying a line that starts with C is a drive on solaris, SD on Linux, and DA/AD on BSD. What happens if my volume is called "crap"? Well that would show up as a drive. That bug has always existed and this doesn't change that. We can use -P on Linux to get the full path which fixes this for Linux, but that doesn't exist on Solaris/BSD (of course).