[SOLVED] Automatic email report after scrub not sent

All your general support questions for OpenZFS on OS X.

[SOLVED] Automatic email report after scrub not sent

Postby zfsfan » Sun Apr 30, 2023 5:03 pm

After configuring /etc/zfs/zed.d/zed.rc as explained at
https://wiki.archlinux.org/title/ZFS#Mo ... _on_Events
and
https://serverfault.com/a/605997
no email report is sent after scrubbing has finished, even with ZED_NOTIFY_VERBOSE=1
I already did a reboot to make sure that zed has read the new config file.
What can I do?

The mail client works (email is received at destination):
Code: Select all
echo "Test"|mail -s 'Testing' email@private-domain.com


And zed is running:
Code: Select all
$ ps aux|grep zed
root               340   0,0  0,0 34156628   3224   ??  Ss   12:09am   0:00.30 /usr/local/zfs/bin/zed -vfF
user              4248   0,0  0,0 34122828    836 s000  S+    2:56am   0:00.00 grep zed
$ sudo launchctl list | grep zed
340   1   org.openzfsonosx.zed
-   0   com.apple.iokit.ioserviceauthorized


Main values in /etc/zfs/zed.d/zed.rc:
Code: Select all
ZED_EMAIL_ADDR="email@private-domain.com"
ZED_EMAIL_PROG="mail"
ZED_EMAIL_OPTS="-s '@SUBJECT@' @ADDRESS@"
ZED_NOTIFY_VERBOSE=1
Last edited by zfsfan on Mon May 01, 2023 4:48 am, edited 1 time in total.
zfsfan
 
Posts: 16
Joined: Sun Mar 19, 2023 5:38 pm

Re: Automatic email report after scrub not sent

Postby zfsfan » Sun Apr 30, 2023 5:42 pm

Running the script manually works, the email is sent.
Obviously zed doesn't run the script after scrubbing has finished.

Code: Select all
$ ZED_ZEDLET_DIR=/etc/zfs/zed.d ZEVENT_POOL=backup1 ZEVENT_SUBCLASS=scrub_finish ZPOOL=/usr/local/zfs/bin/zpool /etc/zfs/zed.d/scrub_finish-notify.sh; echo $?
0
zfsfan
 
Posts: 16
Joined: Sun Mar 19, 2023 5:38 pm

Re: Automatic email report after scrub not sent

Postby cgiard » Sun Apr 30, 2023 6:46 pm

I haven’t tried, but you should make sure the mail command works if run as the root user, not your user account.
cgiard
 
Posts: 22
Joined: Sat Dec 20, 2014 8:10 am

Re: Automatic email report after scrub not sent

Postby zfsfan » Mon May 01, 2023 4:23 am

cgiard wrote:I haven’t tried, but you should make sure the mail command works if run as the root user, not your user account.


As root, OK (0) is returned, but I receive no email:

Code: Select all
# ZED_ZEDLET_DIR=/etc/zfs/zed.d ZEVENT_POOL=backup1 ZEVENT_SUBCLASS=scrub_finish ZPOOL=/usr/local/zfs/bin/zpool /etc/zfs/zed.d/scrub_finish-notify.sh; echo $?
0
zfsfan
 
Posts: 16
Joined: Sun Mar 19, 2023 5:38 pm

Re: Automatic email report after scrub not sent

Postby zfsfan » Mon May 01, 2023 4:30 am

I have updated the postfix configuration, now receiving email by calling the script as root works. Thanks so far!

Now scrubbing is in progress. Let's see ...
zfsfan
 
Posts: 16
Joined: Sun Mar 19, 2023 5:38 pm

Re: Automatic email report after scrub not sent

Postby zfsfan » Mon May 01, 2023 4:47 am

It works now.

Thanks a lot!
zfsfan
 
Posts: 16
Joined: Sun Mar 19, 2023 5:38 pm


Return to General Help

Who is online

Users browsing this forum: No registered users and 21 guests

cron