Notify scrub proxmox 7

frankz

Member
Nov 16, 2020
358
23
23
Hello everyone, I realized that after upgrading to version 7 I don't get email scrub notifications. I checked but at the moment I haven't received anything.

Has anything changed?
 
If I'm not mistaken, you need to edit "/etc/zfs/zed.d/zed.rc" to get email notifications about zfs events.

Mine looks like this:
Bash:
root@Proxmox:~# cat /etc/zfs/zed.d/zed.rc |grep -v "^#"


ZED_EMAIL_ADDR="root"

ZED_EMAIL_PROG="mail"

ZED_EMAIL_OPTS="-s '@SUBJECT@' @ADDRESS@"


ZED_NOTIFY_INTERVAL_SECS=3600

ZED_NOTIFY_VERBOSE=1






ZED_USE_ENCLOSURE_LEDS=1




ZED_SYSLOG_SUBCLASS_INCLUDE="checksum|scrub_*|vdev.*"
ZED_SYSLOG_SUBCLASS_EXCLUDE="history_event"
 
If I'm not mistaken, you need to edit "/etc/zfs/zed.d/zed.rc" to get email notifications about zfs events.

Mine looks like this:
Bash:
root@Proxmox:~# cat /etc/zfs/zed.d/zed.rc |grep -v "^#"


ZED_EMAIL_ADDR="root"

ZED_EMAIL_PROG="mail"

ZED_EMAIL_OPTS="-s '@SUBJECT@' @ADDRESS@"


ZED_NOTIFY_INTERVAL_SECS=3600

ZED_NOTIFY_VERBOSE=1






ZED_USE_ENCLOSURE_LEDS=1




ZED_SYSLOG_SUBCLASS_INCLUDE="checksum|scrub_*|vdev.*"
ZED_SYSLOG_SUBCLASS_EXCLUDE="history_event"
Hello and thank you for replying, but I had modified that file, in fact it has always worked. However, I noticed as written before that since I upgraded to version 7, notifications have not arrived. Can I manually throw scrubs? If so, how do I do it? Thank you
 
Hello and thank you for replying, but I had modified that file, in fact it has always worked. However, I noticed as written before that since I upgraded to version 7, notifications have not arrived. Can I manually throw scrubs? If so, how do I do it? Thank you
Make sure, that you set the email in "/etc/pve/datacenter.cfg".

You should first test, if the host can send any email. Try following:
Bash:
echo -e "Subject: Test\n\nThis is a test" | /usr/bin/pvemailforward

For your second question, yes you can of course manually scrub your zpools.
See "zpool-scrub(8)" for details.

Basically you can start scrub with "zpool scrub <zpool>", pause it with "-p" or stop it with "-s".
 
  • Like
Reactions: frankz
Hello and thank you for replying, but I had modified that file, in fact it has always worked. However, I noticed as written before that since I upgraded to version 7, notifications have not arrived. Can I manually throw scrubs? If so, how do I do it? Thank you
As far as I know PVE won't do scrubs on its own. You need to manually start scrub (zpool scrub YourPool) or create a entry in your /etc/crontab so that root will execute that command for example once per month.
 
As far as I know PVE won't do scrubs on its own. You need to manually start scrub (zpool scrub YourPool) or create a entry in your /etc/crontab so that root will execute that command for example once per month.
This is wrong. ZFS utils has cron for scrubs and trims.
 
  • Like
Reactions: Petr.114
B
Make sure, that you set the email in "/etc/pve/datacenter.cfg".

You should first test, if the host can send any email. Try following:
Bash:
echo -e "Subject: Test\n\nThis is a test" | /usr/bin/pvemailforward

For your second question, yes you can of course manually scrub your zpools.
See "zpool-scrub(8)" for details.

Basically you can start scrub with "zpool scrub <zpool>", pause it with "-p" or stop it with "-s".
It veto, I forgot !!! But if I launch it manually will the same email arrive?
 
B

It veto, I forgot !!! But if I launch it manually will the same email arrive?
Although I didn’t get the first part, but yes, you’ll get a email notifications if your scrub jobs finishes, provided the zed.rc and you emailing is configured correctly.
 
Is it done using a systemd scipt? Atleat here with PVE ontop of Debian there is no cron entry for ZFS utils.
I have this:
Code:
root@Proxmox:~# cat /etc/cron.d/zfsutils-linux
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# TRIM the first Sunday of every month.
24 0 1-7 * * root if [ $(date +\%w) -eq 0 ] && [ -x /usr/lib/zfs-linux/trim ]; then /usr/lib/zfs-linux/trim; fi

# Scrub the second Sunday of every month.
24 0 8-14 * * root if [ $(date +\%w) -eq 0 ] && [ -x /usr/lib/zfs-linux/scrub ]; then /usr/lib/zfs-linux/scrub; fi
root@Proxmox:~#
 
  • Like
Reactions: Dunuin
I have this:
Code:
root@Proxmox:~# cat /etc/cron.d/zfsutils-linux
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# TRIM the first Sunday of every month.
24 0 1-7 * * root if [ $(date +\%w) -eq 0 ] && [ -x /usr/lib/zfs-linux/trim ]; then /usr/lib/zfs-linux/trim; fi

# Scrub the second Sunday of every month.
24 0 8-14 * * root if [ $(date +\%w) -eq 0 ] && [ -x /usr/lib/zfs-linux/scrub ]; then /usr/lib/zfs-linux/scrub; fi
root@Proxmox:~#
Your right, just didn't notived that cron file.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!