由于长期使用mdadm的用户刚刚遇到磁盘错误,并且记得我为磁盘错误configuration了mdadm的自动邮件报告。
因此,我只需要在/etc/mdadm/mdadm.conf中插入我的邮件地址
MAILADDR [email protected]
但是我真的错过了FreeBSD上的那一个。 而且就像我的ZFS RAID6现在运行了半年以上,我想如果磁盘遇到故障会发生什么?
我从来没有configuration任何外部邮件地址。 有没有简单的方法来完成和testing呢?
像在mdadm上一样:
sudo mdadm –monitor –scan –test
而我将如何在Linux上使用ZoL(Linux上的ZFS)呢?
编辑:对不起,我的意思是自动报告。 没有预定。
我知道我可以build立一个脚本并且每分钟parsingzpool状态-X。 但我认为这不是完成报告问题的非常优雅的方法。 最好立即通知磁盘故障(如mdadm)
编辑[2]:感谢您的build议,但没有我卡住了一些脚本问题,有人可以帮我在/ bin / sh我的循环问题在这里 – > PASTEBIN
编辑[3]:得到我的循环问题。 :)(更新在PASTEBIN )
还有什么更多的build议为我的脚本?
运行检查zpool status -x输出的常规脚本(cron)。 从长远来看,Linux上的ZFS项目正在以事件守护进程的forms进行。 Solaris派生的系统可以访问故障pipe理体系结构。
就自动化报告而言,即使NexentaStor等商业解决scheme也使用定期检查。 这没有什么错。
像这样的东西:
[root@mdmarra ~]# zpool status -x all pools are healthy
与以下可怕的事情:
[root@mdmarra ~]# zpool status -x pool: vol1 state: UNAVAIL status: One or more devices are faulted in response to IO failures. action: Make sure the affected devices are connected, then run 'zpool clear'. see: http://www.sun.com/msg/ZFS-8000-JQ scan: scrub repaired 0 in 1h15m with 0 errors on Sun Jul 28 21:15:10 2013 config: NAME STATE READ WRITE CKSUM vol1 UNAVAIL 0 0 0 insufficient replicas mirror-0 DEGRADED 0 0 0 c1t0d0 UNAVAIL 0 0 0 cannot open c2t0d0 ONLINE 0 0 0 mirror-1 DEGRADED 0 0 0 c1t1d0 UNAVAIL 0 0 0 cannot open c2t1d0 ONLINE 0 0 0 mirror-2 DEGRADED 0 0 0 spare-0 UNAVAIL 0 0 0 insufficient replicas c1t2d0 UNAVAIL 0 0 0 cannot open c2t8d0 UNAVAIL 0 0 0 cannot open c2t2d0 ONLINE 0 0 0 mirror-3 DEGRADED 0 0 0 c1t3d0 UNAVAIL 0 0 0 cannot open c2t3d0 ONLINE 0 0 0 mirror-4 DEGRADED 0 0 0 c1t4d0 UNAVAIL 0 0 0 cannot open c2t4d0 ONLINE 0 0 0 mirror-5 UNAVAIL 0 0 0 insufficient replicas c1t5d0 UNAVAIL 0 0 0 cannot open c2t5d0 FAULTED 0 0 0 too many errors cache c3t5d0 ONLINE 0 0 0 spares c2t8d0 UNAVAIL cannot open errors: No known data errors
尝试zfswatcher ,它对我来说真的很好。