Proxmox 8 - zed notifications not working.

moxmox

Well-Known Member
Aug 14, 2019
63
8
48
45
hi

I have postfix setup and I get emails ok if do this

Code:
echo -e "Subject: Test\n\nThis is a test" | /usr/bin/proxmox-mail-forward

what should the /etc/zfs/zed.d/zed.rc config be - there is a log of conflicting info on the forums about how to set it up?
should
ZED_EMAIL_PROG =
mail or postfix?

I would expect zed to work straight out he box but it does not seem to..

I am testing by starting a scrub and stopping it again.
 
Hi,
did you set ZED_NOTIFY_VERBOSE=1? Otherwise, it might be that scrub events will not generate mails unless there are errors. I quickly tested and only got the notification for the scrub finish event with the setting. Use systemctl reload-or-restart zed.service to restart the service after changing the configuration.
 
Thanks for the reply

yes I have that set on already - can you confirm should it be postfix for this?

ZED_EMAIL_PROG="postfix"

Also I do not get the debug file created - /tmp/zed.debug.log

any other ideas or where I can check for error messages? I find since proxmox8 now it uses journalctl for logging rather than separate log files its more difficult to find logs.
 
I can see the events in the syslog as well

Aug 21 13:16:35 nuc11propve zed[991309]: ZFS Event Daemon 2.1.12-pve1 (PID 991309)
Aug 21 13:16:35 nuc11propve zed[991309]: Processing events since eid=602
Aug 21 13:16:46 nuc11propve zed[994980]: eid=603 class=scrub_start pool='pool_media'
Aug 21 13:16:54 nuc11propve zed[999037]: eid=606 class=scrub_abort pool='pool_media'
 
I can see the events in the syslog as well

Aug 21 13:16:35 nuc11propve zed[991309]: ZFS Event Daemon 2.1.12-pve1 (PID 991309)
Aug 21 13:16:35 nuc11propve zed[991309]: Processing events since eid=602
Aug 21 13:16:46 nuc11propve zed[994980]: eid=603 class=scrub_start pool='pool_media'
Aug 21 13:16:54 nuc11propve zed[999037]: eid=606 class=scrub_abort pool='pool_media'

Hi @moxmox - @fiona was right, without setting ZED_NOTIFY_VERBOSE=1 you wont get mail on scrubbing.

# If set to 0, suppress notification if the pool is healthy.
# If set to 1, send notification regardless of pool health.

I tried and testet it, and it works by just setting verbose = 1, rest is default on my site. You also need a configured postfix

ZFS has finished a scrub:

eid: 82
class: scrub_finish
host: PMX4
time: 2023-08-29 15:38:44+0200
pool: test
state: ONLINE
scan: scrub repaired 0B in 00:00:00 with 0 errors on Tue Aug 29 15:38:44 2023
config:


NAME STATE READ WRITE CKSUM
test ONLINE 0 0 0
/tmp/sparse_file ONLINE 0 0 0
errors: No known data errors
 
@jsterr if you just start a scrub and cancel it will you get a notification? I have a large pool so not letting it finish to test each time.
 
@jsterr you can see my comment above I already have that enabled.
I cant see the comment where this can be seen. I also have: ZED_EMAIL_PROG="mail" and not ZED_EMAIL_PROG="postfix"

@jsterr if you just start a scrub and cancel it will you get a notification? I have a large pool so not letting it finish to test each time.

Yes! You can try with:

Code:
cd /tmp
dd if=/dev/zero of=sparse_file bs=1 count=0 seek=512M
zpool create test /tmp/sparse_file
zpool scrub test

# after getting Mail delete the test

zpool export test
rm /tmp/sparse_file

The Mail:


ZFS has finished a scrub:
eid: 78
class: scrub_finish
host: PMX4
time: 2023-
08-29 15:37:26+0200
pool: test
state: ONLINE
scan: scrub repaired 0B in 00:00:00 with 0 errors on Tue Aug 29 15:37:26 2023
config:
NAME STATE READ WRITE CKSUM
test ONLINE 0 0 0
/tmp/sparse_file ONLINE 0 0 0


errors: No known data errors
 
Last edited:
@jsterr using that script I do get a test email - thanks!
I was under the impression that starting and then cancelling a scrub would generate an email but apparently it does not.

thanks for your help :)