Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

The title is pretty self explanatory really! How can I trigger an email if physical disk health degrades? Also as a side point, how can I do similar for software raid or zfs array health?

share|improve this question
3  
Have you done any research on this before asking here? there are lots of ways to do this (smartmon tools for physical disks, software RAID has its own tools for checking status, hardware RAID is usually exposed through IPMI or a vendor-supplied SNMP extension), but you'll have to write some code to make it work in your specific environment... –  voretaq7 Sep 21 '12 at 21:38
    
@voretaq7 is correct. smartmon is the dead simple way to get started ( linuxjournal.com/magazine/monitoring-hard-disks-smart?page=0,2 ) but this is also one of the first things you find if you google around for resources on monitoring disk health. –  MrTuttle Sep 21 '12 at 21:41
1  
You are asking two questions in this post, and they will have two different answers (Physical disk health vs Software RAID/ZFS health). Perhaps break them up into two different posts? –  Stefan Lasiewski Sep 21 '12 at 23:44

2 Answers 2

up vote 1 down vote accepted

This depends on a variety of things. Many raid-controllers have their own tools to query this kind of information;

  • HP's SmartArray-controllers use HP's hpacucli-tool. I would in general recommend using this nagios plugin for checking the health of those disks, and HP server health in general.

  • DELL's servers have their own openmanage-drivers that needs to be queried. A good Nagios-plugin for this is to be found here.

  • If your harddrives support S.M.A.R.T (I believe all of them nowadays do), you can use check_smartmon.

Both of the above check RAID-status as well as physical drives. In some cases, if you make sure to update the plugins now and then - you will also be told when it's appropriate to update your firmware.

  • For software RAID in Linux, check_md_adm can be used.

  • There's a plugin for monitoring ZFS-pools on Nagios Exchange: link.

share|improve this answer
    
For ZFS run zpool status -x. It will either output all pools are healthy. or the pool info (similar to the output of zpool list) if there are any detected errors. –  bahamat Sep 21 '12 at 23:35

Use Smartmontools with Ubuntu. The following is a good tutorial, and I used this on my home desktop machine. Since this is a desktop, I use GSmartControl which provides a nice interface.

https://help.ubuntu.com/community/Smartmontools

For my production servers (which are not Ubuntu), I still use Smartmontools. It's archaic, but the best thing available.

share|improve this answer
    
Fun note: My system failed a month after this post. The failure was not detected by Smartmontools because the failure was a bug in the filesystem (Btrfs on Ubuntu 12.04, which was not production worthy). A learning opportunity. –  Stefan Lasiewski Mar 4 '13 at 4:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.