Anyone managed to get ZFS Event Daemon up and running?

    • OMV 2.x

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Update:

      Setting up the deamon was easier than expected. For everyone who is interested in this feature, here is a small howto:

      1. If not already done setup postfix (easiest way is to use the OMV webgui System->Notifications). After entering all needed information hit the "Send Test mail" button to make sure you recieve email notifications from your box.

      2. edit the ZFS Event Daemon (ZED) config file: nano /etc/zfs/zed.d/zed.rc

      Shell-Script

      1. nano /etc/zfs/zed.d/zed.rc

      Actualy you only have to remove some comments and supply the recievers email address:

      Shell-Script

      1. ##
      2. # zed.rc
      3. #
      4. # This file should be owned by root and permissioned 0600.
      5. ##
      6. ##
      7. # Absolute path to the debug output file.
      8. #
      9. # ZED_DEBUG_LOG="/tmp/zed.debug.log"
      10. ##
      11. # Email address of the zpool administrator for receipt of notifications;
      12. # multiple addresses can be specified if they are delimited by whitespace.
      13. # Email will only be sent if ZED_EMAIL_ADDR is defined.
      14. # Disabled by default; uncomment to enable.
      15. #
      16. ZED_EMAIL_ADDR="MY-ADDRESS@domain.net"
      17. ##
      18. # Name or path of executable responsible for sending notifications via email;
      19. # the mail program must be capable of reading a message body from stdin.
      20. # Email will only be sent if ZED_EMAIL_ADDR is defined.
      21. #
      22. ZED_EMAIL_PROG="mail"
      23. ##
      24. # Command-line options for ZED_EMAIL_PROG.
      25. # The string @ADDRESS@ will be replaced with the recipient email address(es).
      26. # The string @SUBJECT@ will be replaced with the notification subject;
      27. # this should be protected with quotes to prevent word-splitting.
      28. # Email will only be sent if ZED_EMAIL_ADDR is defined.
      29. #
      30. ZED_EMAIL_OPTS="-s '@SUBJECT@' @ADDRESS@"
      31. ##
      32. # Default directory for zed lock files.
      33. #
      34. ZED_LOCKDIR="/var/lock"
      35. ##
      36. # Minimum number of seconds between notifications for a similar event.
      37. #
      38. ZED_NOTIFY_INTERVAL_SECS=3600
      39. ##
      40. # Notification verbosity.
      41. # If set to 0, suppress notification if the pool is healthy.
      42. # If set to 1, send notification regardless of pool health.
      43. #
      44. ZED_NOTIFY_VERBOSE=1
      45. ##
      46. # Pushbullet access token.
      47. # This grants full access to your account -- protect it accordingly!
      48. # <https://www.pushbullet.com/get-started>
      49. # <https://www.pushbullet.com/account>
      50. # Disabled by default; uncomment to enable.
      51. #
      52. #ZED_PUSHBULLET_ACCESS_TOKEN=""
      53. ##
      54. # Pushbullet channel tag for push notification feeds that can be subscribed to.
      55. # <https://www.pushbullet.com/my-channel>
      56. # If not defined, push notifications will instead be sent to all devices
      57. # associated with the account specified by the access token.
      58. # Disabled by default; uncomment to enable.
      59. #
      60. #ZED_PUSHBULLET_CHANNEL_TAG=""
      61. ##
      62. # Default directory for zed state files.
      63. #
      64. ZED_RUNDIR="/var/run"
      65. ##
      66. # Replace a device with a hot spare after N checksum errors are detected.
      67. # Disabled by default; uncomment to enable.
      68. #
      69. #ZED_SPARE_ON_CHECKSUM_ERRORS=10
      70. ##
      71. # Replace a device with a hot spare after N I/O errors are detected.
      72. # Disabled by default; uncomment to enable.
      73. #
      74. #ZED_SPARE_ON_IO_ERRORS=1
      75. ##
      76. # The syslog priority (e.g., specified as a "facility.level" pair).
      77. #
      78. ZED_SYSLOG_PRIORITY="daemon.notice"
      79. ##
      80. # The syslog tag for marking zed events.
      81. #
      82. ZED_SYSLOG_TAG="zed"
      Display All

      3. restart ZED

      Source Code

      1. service zfs-zed restart

      4. to test the daemon we will corrupt some data on the first partition of one of the drives which are part of the pool
      (CAUTION: create a test pool for this!! don't run this commands on your production pool!!!!)

      if aren't able to create a test pool just skip this step. scrubbing of a healthy pool will still create a "scrub finished message"

      Source Code

      1. dd if=/dev/urandom of=/dev/<select a disc of your pool>1 bs=1024 count=200480


      5. scrub the pool

      Source Code

      1. zpool scrub <your pool name>

      6. check the status of the pool by running

      Source Code

      1. zpool status

      Source Code

      1. pool: zfs_test_pool
      2. state: ONLINE
      3. status: One or more devices has experienced an unrecoverable error. An
      4. attempt was made to correct the error. Applications are unaffected.
      5. action: Determine if the device needs to be replaced, and clear the errors
      6. using 'zpool clear' or replace the device with 'zpool replace'.
      7. see: http://zfsonlinux.org/msg/ZFS-8000-9P
      8. scan: scrub repaired 0 in 0h0m with 0 errors on Sat Jul 23 23:59:33 2016
      9. config:
      10. NAME STATE READ WRITE CKSUM
      11. zfs_test_pool ONLINE 0 0 0
      12. mirror-0 ONLINE 0 0 0
      13. xen-vbd-832 ONLINE 0 0 0
      14. xen-vbd-5632 ONLINE 0 0 8
      15. errors: No known data errors
      Display All


      Now you should have two new mails with status updates in your inbox ;)

      The post was edited 1 time, last by Monchi ().