knorrie / python-btrfs

Python Btrfs module
GNU Lesser General Public License v3.0
112 stars 22 forks source link

corruption_errors are reported as generation_errors in check_btrfs #21

Closed kepi closed 5 years ago

kepi commented 5 years ago

Hello,

today one of our disks started to report corruption error:

$ btrfs dev stats /
[/dev/sdf2].write_io_errs   0
[/dev/sdf2].read_io_errs    0
[/dev/sdf2].flush_io_errs   0
[/dev/sdf2].corruption_errs 1
[/dev/sdf2].generation_errs 0

But Nagios plugin check_btrfs is reporting that wrongly as generation errors:

$ ./check_btrfs -m /
BTRFS CRITICAL: Device 1: generation_errs: 1
Physical size: 74.43GiB, Allocatable: 74.43GiB, Allocated: 30.05GiB (40%), Unallocatable: 0.00B (Reclaimable: 0.00B), Virtual used: 22.09GiB (30%), 1 device(s)
knorrie commented 5 years ago

Hi Kepi, Thanks for your report. You are completely right. Apparently when writing this code, I mixed up two of them.

I have pushed a commit with a fix. When I finish writing the first version of the new btrfs-search-metadata utility, I'm going to do a new release.

Thanks, Knorrie

kepi commented 5 years ago

Just confirming that fix is working, thanks for quick fix.