From: Duncan <1i5t5.duncan@cox.net>
To: linux-btrfs@vger.kernel.org
Subject: Re: Nagios probe for btrfs RAID status?
Date: Sat, 23 Nov 2013 16:32:57 +0000 (UTC) [thread overview]
Message-ID: <pan$98b65$bf0f3e19$35b6bfa7$de9e854@cox.net> (raw)
In-Reply-To: 52909519.7080508@pocock.com.au
Daniel Pocock posted on Sat, 23 Nov 2013 12:44:25 +0100 as excerpted:
>> [btrfs manpage quote]
>> btrfs device stats [-z] {<path>|<device>}
>>
>> Read and print the device IO stats for all devices of the filesystem
>> identified by <path> or for a single <device>.
>> -z Reset stats to zero after reading them.
>> Here's the output for my (dual device btrfs raid1) rootfs, here:
>>
>> btrfs dev stat /
>> [/dev/sdc5].write_io_errs 0
>> [/dev/sdc5].read_io_errs 0
>> [/dev/sdc5].flush_io_errs 0
>> [/dev/sdc5].corruption_errs 0
>> [/dev/sdc5].generation_errs 0
>> [/dev/sda5].write_io_errs 0
>> [/dev/sda5].read_io_errs 0
>> [/dev/sda5].flush_io_errs 0
>> [/dev/sda5].corruption_errs 0
>> [/dev/sda5].generation_errs 0
>>
>> As you can see, for multi-device filesystems it gives the stats per
>> component device. Any errors accumulate until a reset using -z, so you
>> can easily see if the numbers are increasing over time and by how much.
> That looks interesting - are these explained anywhere?
I'd guess in the sources... There's nothing more in the manpage about
them, and nothing on the wiki. Some weeks ago I scanned some of the
whitepapers listed on the wiki, and found most of them frustratingly "big
picture" vague on such details as well. =:^( There was one that had a
bit of detail, but only about half of what I was looking for at the time
(the difference between leafsize, sectorsize and nodesize, three option
knobs available on the mkfs.btrfs commandline, and what they actually
tuned, and while I was at it, how they related to btrfs chunks) was there
either, and even then not really explained very clearly). So it seems a
lot of the documentation is sources-only at this point. =:^(
> Should a Nagios plugin just look for any non-zero value or just focus on
> some of those?
I could guess at what some of them are and their significance based on
what I've seen here, but I'm afraid my guesses wouldn't rate well in SNR
terms, so I'll abstain...
> Are they runtime stats (since system boot) or are they maintained in the
> filesystem on disk?
The records are maintained across mounts/boots so must be stored on-
disk. Only the -z switch zeroes.
> My own version of the btrfs utility doesn't have that command though, I
> am using a Debian stable system. I tried a newer version and it gives
>
> ERROR: ioctl(BTRFS_IOC_GET_DEV_STATS)
>
> so I probably need to update my kernel too.
You've likely read it before, but btrfs remains a filesystem under heavy
development, with every kernel bringing fixes for known bugs and
userspace tools developed in tandem, and every btrfs user at this point
is by definition a development filesystem tester. While there are
reasons one may wish to be conservative and stick with a known stable
system, they really tend to be antithetical with the reasons one would
have for testing something as development edge as btrfs at this point.
Thus, upgrading to a current kernel (3.12.x at this point, if not 3.13
development kernel as rc1 just came out) and btrfs-progs (at least, you
can keep the rest of the system stable Debian if you like) is very
strongly recommended if you're testing btrfs, in any case.
(For btrfs-progs, development happens in git branches, with merges to the
master branch only when changes are considered release-ready. So current
git-master btrfs-progs is always the reference. FWIW, here's what btrfs
--version outputs here, btrfs-progs from git updated as of yesterday as
it happens, tho I usually keep within a week or two: Btrfs v0.20-rc1-598-
g8116550.)
See the btrfs wiki for more: https://btrfs.wiki.kernel.org.
--
Duncan - List replies preferred. No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master." Richard Stallman
prev parent reply other threads:[~2013-11-23 16:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-22 13:47 Nagios probe for btrfs RAID status? Daniel Pocock
2013-11-22 17:52 ` Duncan
2013-11-23 3:59 ` Anand Jain
2013-11-23 8:37 ` Daniel Pocock
2013-11-23 9:20 ` Daniel Pocock
2013-11-23 10:35 ` Duncan
2013-11-23 11:44 ` Daniel Pocock
2013-11-23 16:32 ` Duncan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='pan$98b65$bf0f3e19$35b6bfa7$de9e854@cox.net' \
--to=1i5t5.duncan@cox.net \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).