I really need to see the OP's zed.rc file. The salt code doesn't add an address if notifications aren't enabled.
zfs degraded, no mail or any other alert.
-
- OMV 6.x
- gelöst
- tdriver
-
-
-
It is configured as expected then. There would be no email addr is notifications weren't enabled. I recommend trying Krisbee's post who has more knowledge about zfs than I do.
-
i found this on another site ,not sure if its legit :
"un-plugging a drive to make it degraded?
zed, for whatever reason percieves the sys-admin removing drives as not a zfs fault and thusly doesnt send emails" -
ryecoaaron tdriver et al
After a bit of poking around and googling, this thread at github re: zfs issue seems the most relevant:
https://github.com/openzfs/zfs/issues/10123 which refers to this: https://forum.proxmox.com/thre…graded.87629/#post-520096
I've not time to digest this until tomorrow.
-
It sounds like a removed drive gives an UNAVAIL state change not degraded. The notification was fixed in 2.1.3. I'm not clear on what the correct fix is to notify on UNAVAIL. Sounds like you need to add ZED_NOTIFY_VERBOSE=1 to zed.rc. If someone can confirm that, I could add it to the plugin.
-
It sounds like a removed drive gives an UNAVAIL state change not degraded. The notification was fixed in 2.1.3. I'm not clear on what the correct fix is to notify on UNAVAIL. Sounds like you need to add ZED_NOTIFY_VERBOSE=1 to zed.rc. If someone can confirm that, I could add it to the plugin.
I agree it needs to change or become user configurable. I'm just going through some tests again after changing zed.rc
The current version of statechange-notify.sh should generate an email for DEGRADED, FAULTED, REMOVED or UNAVAIL. It includes the fix from a previous issue raised at zfs github.
I changed my zed.rc to this in order to try to catch all events while testing.
Code# This file is auto-generated by openmediavault (https://www.openmediavault.org) # WARNING: Do not edit this file, your changes will get lost. ZED_EMAIL_ADDR=dummysmtp@gmail.com ZED_NOTIFY_INTERNAL_SECS=3600 ZED_NOTIFY_VERBOSE=1 ZED_SYSLOG_SUBCLASS_INCLUDE="*"
When I pull a drive from the VM, it is FAULTED in the ZFS pool and the associated statechange event is generated as expected:
After changing zed.rc, an email alert is now generated correctly for this event with a matching time:
Code
Alles anzeigenroot@omv7vm:/# postcat -q 287E720E20 *** ENVELOPE RECORDS deferred/2/287E720E20 *** message_size: 954 310 2 0 954 0 message_arrival_time: Thu Feb 29 08:40:40 2024 create_time: Thu Feb 29 08:40:40 2024 named_attribute: rewrite_context=local sender_fullname: root sender: dummysmtp@gmail.com named_attribute: notify_flags=1 original_recipient: openmediavault-notification@localhost.localdomain done_recipient: openmediavault-notification@localhost.localdomain *** MESSAGE CONTENTS deferred/2/287E720E20 *** Received: by omv7vm.home.arpa (Postfix, from userid 0) id 287E720E20; Thu, 29 Feb 2024 08:40:40 +0000 (GMT) To: dummysmtp@gmail.com Subject: ZFS device fault for pool xpool on omv7vm MIME-Version: 1.0 Content-Type: text/plain; charset="ANSI_X3.4-1968" Content-Transfer-Encoding: 8bit Message-Id: <20240229084040.287E720E20@omv7vm.home.arpa> Date: Thu, 29 Feb 2024 08:40:40 +0000 (GMT) From: root <dummysmtp@gmail.com> The number of I/O errors associated with a ZFS device exceeded acceptable levels. ZFS has marked the device as faulted. impact: Fault tolerance of the pool may be compromised. eid: 15 class: statechange state: FAULTED host: omv7vm time: 2024-02-29 08:40:40+0000 vpath: /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-0-5-part1 vphys: pci-0000:08:01.0-scsi-0:0:5:0 vguid: 0xED714F8C9F924B53 devid: scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-0-5-part1 pool: xpool (0xB72C4FE09733D70B) *** HEADER EXTRACTED deferred/2/287E720E20 *** named_attribute: encoding=8bit named_attribute: dsn_orig_rcpt=rfc822;dummysmtp@gmail.com original_recipient: dummysmtp@gmail.com recipient: dummysmtp@gmail.com *** MESSAGE FILE END deferred/2/287E720E20 *** root@omv7vm:/#
-
I changed my zed.rc to this in order to try to catch all events while testing.
Ok, just let me know if you think I should have the plugin add these two lines:
ZED_NOTIFY_VERBOSE=1
ZED_SYSLOG_SUBCLASS_INCLUDE="*"
The plugin doesn't have a settings tab. So, if people wanted to disable these, it would probably have to be environment variables. Or they are just added to every system.
-
Just adding ZED_NOTIFY_VERBOSE=1 to zed.rc does seem to be sufficient, but would you also consider adding ZED_SYSLOG_SUBCLASS_EXCLUDE="history_event" This comes from the default debian/proxmox zed.rc which includes:
Code## # Which set of event subclasses to log # By default, events from all subclasses are logged. # If ZED_SYSLOG_SUBCLASS_INCLUDE is set, only subclasses # matching the pattern are logged. Use the pipe symbol (|) # or shell wildcards (*, ?) to match multiple subclasses. # Otherwise, if ZED_SYSLOG_SUBCLASS_EXCLUDE is set, the # matching subclasses are excluded from logging. #ZED_SYSLOG_SUBCLASS_INCLUDE="checksum|scrub_*|vdev.*" ZED_SYSLOG_SUBCLASS_EXCLUDE="history_event"
-
For anyone else reading this, testing would have been a lot lot quicker had I known about zinject ( part of the zfs-test suite) before hand.
zinject.8 — OpenZFS documentation
I daresay you'd be brave to try it on a live zfs pool, but all you need to create a degraded pool is something like:
root@omv7vm:~# zinject -d scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-0-6 -A degrade xpool
which instantly degrades the pool and an email is generated.
Code
Alles anzeigenroot@omv7vm:~# zpool status pool: xpool state: DEGRADED status: One or more devices has experienced an unrecoverable error. An attempt was made to correct the error. Applications are unaffected. action: Determine if the device needs to be replaced, and clear the errors using 'zpool clear' or replace the device with 'zpool replace'. see: https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-9P scan: resilvered 1.19G in 00:00:07 with 0 errors on Thu Feb 29 11:48:50 2024 config: NAME STATE READ WRITE CKSUM xpool DEGRADED 0 0 0 mirror-0 DEGRADED 0 0 0 scsi-0QEMU_QEMU_HARDDISK_drive-scsi1-0-0 ONLINE 0 0 0 scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-0-6 DEGRADED 0 0 0 too many errors errors: No known data errors root@omv7vm:~ root@omv7vm:~# postcat -q D781320E78 *** ENVELOPE RECORDS deferred/D/D781320E78 *** message_size: 965 310 2 0 965 0 message_arrival_time: Thu Feb 29 11:53:56 2024 create_time: Thu Feb 29 11:53:56 2024 named_attribute: rewrite_context=local sender_fullname: root sender: dummysmtp@gmail.com named_attribute: notify_flags=1 original_recipient: openmediavault-notification@localhost.localdomain done_recipient: openmediavault-notification@localhost.localdomain *** MESSAGE CONTENTS deferred/D/D781320E78 *** Received: by omv7vm.home.arpa (Postfix, from userid 0) id D781320E78; Thu, 29 Feb 2024 11:53:56 +0000 (GMT) To: dummysmtp@gmail.com Subject: ZFS device fault for pool xpool on omv7vm MIME-Version: 1.0 Content-Type: text/plain; charset="ANSI_X3.4-1968" Content-Transfer-Encoding: 8bit Message-Id: <20240229115356.D781320E78@omv7vm.home.arpa> Date: Thu, 29 Feb 2024 11:53:56 +0000 (GMT) From: root <dummysmtp@gmail.com> The number of checksum errors associated with a ZFS device exceeded acceptable levels. ZFS has marked the device as degraded. impact: Fault tolerance of the pool may be compromised. eid: 20674 class: statechange state: DEGRADED host: omv7vm time: 2024-02-29 11:53:56+0000 vpath: /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-0-6-part1 vphys: pci-0000:08:01.0-scsi-0:0:6:0 vguid: 0x315333FD038FBBB3 devid: scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-0-6-part1 pool: xpool (0xB72C4FE09733D70B) *** HEADER EXTRACTED deferred/D/D781320E78 *** named_attribute: encoding=8bit named_attribute: dsn_orig_rcpt=rfc822;dummysmtp@gmail.com original_recipient: dummysmtp@gmail.com recipient: dummysmtp@gmail.com *** MESSAGE FILE END deferred/D/D781320E78 ***
To clear up:
zinject -c all
And clear pool as necessary.
-
Just adding ZED_NOTIFY_VERBOSE=1 to zed.rc does seem to be sufficient, but would you also consider adding ZED_SYSLOG_SUBCLASS_EXCLUDE="history_event" This comes from the default debian/proxmox zed.rc which includes
Added - https://github.com/OpenMediaVa…8d87b5796cdbdee99bc377ce7
-
should i wait for an update then, or edit zed.rc ?
-
should i wait for an update then, or edit zed.rc ?
I would edit the file. When the update goes out, it won't have anything to change.
-
tdriver
Hat das Label gelöst hinzugefügt. -
ok, thank you all. i change this thread to resolved.
-
tdriver I shouldn't think it would be long before an update appears. As ryecoarron says, you can edit /etc/zfs/zed.d/zed.rc now if you wanted. Beware any changes will be over-written if you make, save and apply an changes to your Notifications settings in the WebUI and of course finally by the awaited update. If you edit zed.rc you must also restart the zfs-zed service by systemctl restart zfs-zed
-
If you edit zed.rc you must also restart the zfs-zed service
The plugin isn't doing that. Guess I will have to make that change.
-
restart zfs-zed service when rewriting zed.rc · OpenMediaVault-Plugin-Developers/openmediavault-zfs@267f71fSigned-off-by: Aaron Murray <plugins@omv-extras.org>github.com
Jetzt mitmachen!
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!