#!/usr/bin/perl

$command = `/usr/local/Mega/StorCLI/storcli64 -LDInfo -Lall -aALL \> MegaSAS.log`;

$raid = `grep "State" MegaSAS.log`;

if ($raid =~ /Optimal/) {
	print "Optimal\n";
} else {
	`php ./sendmail.php`;
}
