zpool-status
Parse output from the zpool status ZFS command in Python.
About
This project contains:
- A Python module
zpool_status.pythat convertszpool statusoutput into a Python datastructure. - A Python script
zpool-statusthat serves as a drop-in replacement for thezpool statuscommand that produces JSON output.
Install
Install zpool-status using pip:
$ pip install zpool-status
Command-line interface
The zpool-status script provides a command-line interface that is identical
to the one of zpool-status(1). The only difference is that zpool-status
produces JSON output.
zpool-status [-c [script1[,script2]...]] [-igLpPstv] [-T d|u] [pool] ... [interval [count]]
Example
Suppose we get the following output from zpool status:
$ zpool status -v tank
pool: tank
state: UNAVAIL
status: One or more devices are faulted in response to IO failures.
action: Make sure the affected devices are connected, then run 'zpool clear'.
see: http://www.sun.com/msg/ZFS-8000-HC
scrub: scrub completed after 0h0m with 0 errors on Tue Feb 2 13:08:42 2010
config:
NAME STATE READ WRITE CKSUM
tank UNAVAIL 0 0 0 insufficient replicas
c1t0d0 ONLINE 0 0 0
c1t1d0 UNAVAIL 4 1 0 cannot open
errors: Permanent errors have been detected in the following files:
/tank/data/aaa
/tank/data/bbb
/tank/data/ccc
The following shell command line:
$ zpool-status -v tank
is identical to the this Python code:
import json
from zpool_status import ZPool
zpool = ZPool("tank", options=["-v"])
status = zpool.get_status()
print(json.dumps(status, indent=2))
Both produce this output:
{
"pool": "tank",
"state": "UNAVAIL",
"status": "One or more devices are faulted in response to IO failures.",
"action": "Make sure the affected devices are connected, then run 'zpool clear'.",
"see": "http://www.sun.com/msg/ZFS-8000-HC",
"scrub": "scrub completed after 0h0m with 0 errors on Tue Feb 2 13:08:42 2010",
"config": [
{
"name": "tank",
"state": "UNAVAIL",
"read": 0,
"write": 0,
"cksum": 0,
"message": "insufficient replicas",
"type": "pool",
"devices": [
{
"name": "c1t0d0",
"state": "ONLINE",
"read": 0,
"write": 0,
"cksum": 0,
"type": "device"
},
{
"name": "c1t1d0",
"state": "UNAVAIL",
"read": 4,
"write": 1,
"cksum": 0,
"message": "cannot open",
"type": "device"
}
]
}
],
"errors": [
"Permanent errors have been detected in the following files:",
"",
"/tank/data/aaa",
"/tank/data/bbb",
"/tank/data/ccc"
]
}
Metadata
Release files for zpool-status 0.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| zpool_status-0.2.4.tar.gz | 7.9 kB | Without provenance | Details for zpool_status-0.2.4.tar.gz |
Release files / zpool_status-0.2.4.tar.gz
| Download URL | zpool_status-0.2.4.tar.gz |
|---|---|
| Size | 7.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b5be0fe36d0aae18711bfc6df68f0438998ff80535a9974f2396db4acb6893df
|
|
BLAKE2b-256 checksum How to use checksums |
0d1659ff65f17be8290b1e54a6c18b787b7f4edd797960121af7f4475b32dd11
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.5
|
Security for zpool-status 0.2.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.