On Thu, Jan 13, 2011 at 7:07 AM, Boris Kochergin <sp...@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
fjwc...@gmail.com
_______________________________________________
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"

Reply via email to