Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Jan 2011 11:02:26 -0800
From:      Freddie Cash <fjwcash@gmail.com>
To:        Boris Kochergin <spawk@acm.poly.edu>
Cc:        Alexander Leidinger <Alexander@leidinger.net>, freebsd-stable <freebsd-stable@freebsd.org>, Chris Forgeron <cforgeron@acsi.ca>
Subject:   Re: ZFS - hot spares : automatic or not?
Message-ID:  <AANLkTimFeZX_suAJUB0ciAxKXvQvzQm1YHK6vpywt5gC@mail.gmail.com>
In-Reply-To: <4D2F1534.7010500@acm.poly.edu>
References:  <4D228F41.7040403@langille.org> <4D23504D.8060103@libeljournal.com> <4D2BD0A7.9060003@langille.org> <4D2C810E.2070007@libeljournal.com> <BEBC15BA440AB24484C067A3A9D38D7E0149F32D3484@server7.acsi.ca> <4D2E4C61.80407@acm.poly.edu> <20110113154249.12101reh2to1rqe8@webmail.leidinger.net> <4D2F1534.7010500@acm.poly.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jan 13, 2011 at 7:07 AM, Boris Kochergin <spawk@acm.poly.edu> wrote:
> Did a little research. In at least the ZFS case, it appears that events are
> available through devctl(4) and are therefore accessible through devd:
>
> http://2007.asiabsdcon.org/papers/P16-paper.pdf - section 3.7

PC-BSD has the following additions to their /etc/devd.conf file:
# Sample ZFS problem reports handling.
notify 10 {
        match "system"          "ZFS";
        match "type"            "zpool";
        action "logger -p kern.err 'ZFS: failed to load zpool $pool'";
};

notify 10 {
        match "system"          "ZFS";
        match "type"            "vdev";
        action "logger -p kern.err 'ZFS: vdev failure, zpool=$pool type=$type'";
};

notify 10 {
        match "system"          "ZFS";
        match "type"            "data";
        action "logger -p kern.warn 'ZFS: zpool I/O failure,
zpool=$pool error=$zio_err'";
};

notify 10 {
        match "system"          "ZFS";
        match "type"            "io";
        action "logger -p kern.warn 'ZFS: vdev I/O failure,
zpool=$pool path=$vdev_path offset=$zio_offset size=$zio_size
error=$zio_err'";
};

notify 10 {
        match "system"          "ZFS";
        match "type"            "checksum";
        action "logger -p kern.warn 'ZFS: checksum mismatch,
zpool=$pool path=$vdev_path offset=$zio_offset size=$zio_size'";
};

So it's very (relatively) easy to configure devd to do this.

We just need some scripts to plug into the action lines above.  :)


-- 
Freddie Cash
fjwcash@gmail.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimFeZX_suAJUB0ciAxKXvQvzQm1YHK6vpywt5gC>