leeroybrown wrote: » As djmarkus say if it's just a NAS box that will be setup as a 'stable' system then Linux software RAID5 is worth serious consideration.
#!/usr/bin/perl -w use Net::SMTP::TLS; sub send_mail { my $to = $_[0]; my $subject = $_[1]; my $body = $_[2]; my $from = 'you@gmail.com'; my $password = 'foobar'; my $smtp; if (not $smtp = Net::SMTP::TLS->new('smtp.gmail.com', Port => 587, User => "$from", Password=> "$password", Debug => 1 )) { die "Could not connect to server\n"; } $smtp->mail($from . "\n"); $smtp->to($to . "\n"); $smtp->data(); $smtp->datasend("From: " . $from . "\n"); $smtp->datasend("To: " . $to . "\n"); $smtp->datasend("Subject: " . $subject . "\n"); $smtp->datasend("\n"); $smtp->datasend($body . "\n"); $smtp->dataend(); $smtp->quit; } $failures = `grep "[*_*]" /proc/mdstat | wc -l`; $body = "Report on Arrays:\n"; $body = $body."Raid Reports: md0:\n".`/sbin/mdadm -D /dev/md0`."\n"; $body = $body."Raid Reports: md1:\n".`/sbin/mdadm -D /dev/md1`."\n"; $body = $body."dmesg:\n".`/bin/dmesg | tail -100`; &send_mail('to@address", "Raid Report, $failures failures", "$body");
if ($failures > 0) { &send_mail('my_email_address@gmail.com', "Raid array failure!, $failures failures", "$body"); }