Mein Haus, meine Stra├če, mein Blob

Dez 14, 2014

zed, the ZFS event daemon

ZoL 0.6.3 introduced the ZFS event daemon, zed. It can execute scripts for every event ZFS generates (see zpool events). A basic, but pretty useful example: Get a mail including a detailed report every a pool scrub finishes. Of course, anything you can script, you can do. The (small) drawback: At least the ZoL packages for Ubuntu ship without config files, examples and an upstart script for zed.

The config file zed.rc can be found on github, as well as examples to get you started. Both the rc as well as the scripts go in /etc/zfs/zed.d/.

This leaves us with a working daemon, but it won't automatically start. Here's a basic upstart file to fix that.

# zed - the ZFS  event daemon

description "The ZFS event daemon"

start on local-filesystems
stop on runlevel [!2345]

expect daemon

exec /sbin/zed

Put that bit in /etc/init/zed.conf and you've got zed up and running after reboots.