Skip to content

Commit 6089f58

Browse files
committed
Expose zpool status metrics
1 parent fdcc68b commit 6089f58

11 files changed

+692
-56
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__pycache__

Diff for: tests/__init__.py

Whitespace-only changes.

Diff for: tests/fixtures/zpool_status_-p

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
pool: pool0
2+
state: ONLINE
3+
scan: scrub repaired 0B in 06:58:02 with 0 errors on Sun Nov 12 07:22:03 2023
4+
config:
5+
6+
NAME STATE READ WRITE CKSUM
7+
pool0 ONLINE 0 0 0
8+
raidz1-0 ONLINE 0 0 0
9+
ata-TOSHIBA_MG09ACA18TE_82X0A0QMFJDH ONLINE 0 0 0
10+
ata-TOSHIBA_MG09ACA18TE_82J0A00FFJDH ONLINE 0 0 0
11+
ata-TOSHIBA_MG09ACA18TE_82X0A0QPFJDH ONLINE 0 0 0
12+
13+
errors: No known data errors
14+
15+
pool: pool1
16+
state: ONLINE
17+
scan: scrub repaired 1M in 00:04:45 with 0 errors on Sun Nov 12 00:28:47 2023
18+
config:
19+
20+
NAME STATE READ WRITE CKSUM
21+
pool1 ONLINE 0 0 0
22+
mirror-0 ONLINE 0 0 0
23+
nvme-Samsung_SSD_980_500GB_S64DNL0T824602E-part1 ONLINE 0 0 0
24+
nvme-Samsung_SSD_980_500GB_S64DNL0T824555Z-part1 ONLINE 0 0 0
25+
26+
errors: No known data errors

Diff for: tests/fixtures/zpool_status_-p_degraded

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
pool: tank
2+
state: DEGRADED
3+
status: One or more devices could not be opened. Sufficient replicas exist for
4+
the pool to continue functioning in a degraded state.
5+
action: Attach the missing device and online it using 'zpool online'.
6+
see: http://www.sun.com/msg/ZFS-8000-2Q
7+
scrub: none requested
8+
config:
9+
10+
NAME STATE READ WRITE CKSUM
11+
tank DEGRADED 0 0 0
12+
mirror-0 DEGRADED 0 0 0
13+
c1t0d0 ONLINE 0 0 0
14+
c1t1d0 UNAVAIL 0 0 0 cannot open
15+
16+
errors: No known data errors

Diff for: tests/fixtures/zpool_status_-p_degraded_sparse

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
pool: test
2+
state: DEGRADED
3+
status: One or more devices could not be used because the label is missing or
4+
invalid. Sufficient replicas exist for the pool to continue
5+
functioning in a degraded state.
6+
action: Replace the device using 'zpool replace'.
7+
see: http://zfsonlinux.org/msg/ZFS-8000-4J
8+
scan: resilvered 25.8M in 0h0m with 0 errors on Fri Aug 22 12:02:46 2014
9+
config:
10+
11+
NAME STATE READ WRITE CKSUM
12+
test DEGRADED 0 0 0
13+
mirror-0 DEGRADED 0 0 0
14+
spare-0 DEGRADED 1 0 0
15+
ata-VBOX_HARDDISK_VBb80f1f56-538e9acf ONLINE 0 0 1
16+
16876260487220383698 FAULTED 0 0 0 was /dev/disk/by-path/pci-0000:00:0d.0-scsi-12:0:0:0-part1
17+
ata-VBOX_HARDDISK_VB875e28a5-4b293298 ONLINE 0 0 0
18+
mirror-1 ONLINE 0 0 0
19+
ata-VBOX_HARDDISK_VB4145ff65-9b1320a3 ONLINE 0 0 0
20+
ata-VBOX_HARDDISK_VBee9d66a1-edf52bff ONLINE 0 0 0
21+
spares
22+
pci-0000:00:0d.0-scsi-10:0:0:0 AVAIL
23+
pci-0000:00:0d.0-scsi-11:0:0:0 AVAIL
24+
pci-0000:00:0d.0-scsi-12:0:0:0 AVAIL
25+
pci-0000:00:0d.0-scsi-13:0:0:0 AVAIL

Diff for: tests/fixtures/zpool_status_-p_logs

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
pool: zones
2+
state: DEGRADED
3+
status: One or more devices could not be opened. Sufficient replicas exist for
4+
the pool to continue functioning in a degraded state.
5+
action: Attach the missing device and online it using 'zpool online'.
6+
see: http://illumos.org/msg/ZFS-8000-2Q
7+
scan: scrub repaired 0 in 29h37m with 0 errors on Thu Jul 14 18:42:06 2016
8+
config:
9+
10+
NAME STATE READ WRITE CKSUM
11+
zones DEGRADED 0 0 0
12+
mirror-0 DEGRADED 0 0 0
13+
9669136929555758172 UNAVAIL 0 0 0 was /dev/dsk/c0t5000C5006349E003d0s0
14+
c0t5000C500631F81E7d0 ONLINE 0 0 0
15+
mirror-1 ONLINE 0 0 0
16+
c0t5000C500634A297Bd0 ONLINE 0 0 0
17+
c0t5000C500634B4EA3d0 ONLINE 0 0 0
18+
logs
19+
c0t55CD2E404B73663Dd0 ONLINE 0 0 0
20+
21+
errors: No known data errors

Diff for: tests/fixtures/zpool_status_-p_resilvered

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
pool: rpool
2+
state: DEGRADED
3+
status: One or more devices could not be opened. Sufficient replicas exist for
4+
the pool to continue functioning in a degraded state.
5+
action: Attach the missing device and online it using 'zpool online'.
6+
see: http://www.sun.com/msg/ZFS-8000-2Q
7+
scan: resilvered 1.41M in 0h0m with 0 errors on Tue Nov 15 05:31:36 2011
8+
config:
9+
10+
NAME STATE READ WRITE CKSUM
11+
rpool DEGRADED 0 0 0
12+
mirror-0 DEGRADED 0 0 0
13+
c4d1s0 UNAVAIL 0 0 0 cannot open
14+
c2t1d0s0 ONLINE 0 0 0
15+
c3d1s0 UNAVAIL 0 0 0 cannot open
16+
17+
errors: No known data errors
18+
19+
pool: zpool
20+
state: UNAVAIL
21+
status: One or more devices could not be opened. There are insufficient
22+
replicas for the pool to continue functioning.
23+
action: Attach the missing device and online it using 'zpool online'.
24+
see: http://www.sun.com/msg/ZFS-8000-3C
25+
scan: none requested
26+
config:
27+
28+
NAME STATE READ WRITE CKSUM
29+
zpool UNAVAIL 0 0 0 insufficient replicas
30+
raidz1-0 UNAVAIL 0 0 0 insufficient replicas
31+
c2t1d0p2 ONLINE 0 0 0
32+
c4d1p2 UNAVAIL 0 0 0 cannot open
33+
c3d1p2 UNAVAIL 0 0 0 cannot open

Diff for: tests/fixtures/zpool_status_-p_scrub

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
pool: freenas-boot
2+
state: ONLINE
3+
scan: scrub repaired 0 in 0h2m with 0 errors on Wed Jan 25 03:47:27 2017
4+
config:
5+
6+
NAME STATE READ WRITE CKSUM
7+
freenas-boot ONLINE 0 0 0
8+
da0p2 ONLINE 0 0 0
9+
10+
errors: No known data errors
11+
12+
pool: nas_zfs_vol0
13+
state: ONLINE
14+
scan: scrub repaired 0 in 7h7m with 0 errors on Sun Jan 8 07:07:22 2017
15+
config:
16+
17+
NAME STATE READ WRITE CKSUM
18+
nas_zfs_vol0 ONLINE 0 0 0
19+
mirror-0 ONLINE 0 0 0
20+
gptid/a855d0c8-5218-11e3-9e38-10604b926998 ONLINE 0 0 0
21+
gptid/a8c3fe2f-5218-11e3-9e38-10604b926998 ONLINE 0 0 0
22+
mirror-1 ONLINE 0 0 0
23+
gptid/a91ebd06-5218-11e3-9e38-10604b926998 ONLINE 0 0 0
24+
gptid/a96f4d37-5218-11e3-9e38-10604b926998 ONLINE 0 0 0

Diff for: tests/fixtures/zpool_status_-p_unavail

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
pool: tank
2+
state: UNAVAIL
3+
status: One or more devices are faulted in response to IO failures.
4+
action: Make sure the affected devices are connected, then run 'zpool clear'.
5+
see: http://www.sun.com/msg/ZFS-8000-HC
6+
scrub: scrub completed after 0h0m with 0 errors on Tue Feb 2 13:08:42 2010
7+
config:
8+
9+
NAME STATE READ WRITE CKSUM
10+
tank UNAVAIL 0 0 0 insufficient replicas
11+
c1t0d0 ONLINE 0 0 0
12+
c1t1d0 UNAVAIL 4 1 0 cannot open
13+
14+
errors: Permanent errors have been detected in the following files:
15+
16+
/tank/data/aaa
17+
/tank/data/bbb
18+
/tank/data/ccc

0 commit comments

Comments
 (0)