Of course!
4x 1.5TB HD in Raidz1
16GB DDR3 ECC Memory
AMD FX-8120
8GB Flash drive.
I am using a modified Smart script that I found in another post:
Code:
#!/usr/local/bin/sh
#
# Place this in /mnt/pool/scripts
# Call: sh esmart.sh /dev/ada0
# switch1 is the drive to check (passed parameter)
switch1=$1
# This will use the characters after "/dev/" for the temp file names.
# Example: /dev/ada0 becomes coverada0 or cover0ada0 or cover1ada0
# This needs to be done to keep multiple jobs from using the same files.
drv=`echo $switch1 | cut -c6-`
# Variable just so we can add a note that the drive was asleep when the
# application started but is now awake.
c=0
# Process to run our check on the drive
chkdrive()
{
smartctl -H -n standby -l error ${switch1} > /var/cover0${drv}
}
chkdrive
while [ $? != "0" ]
do
# Pause the checking of the drive to about once a minute if the drive is not running.
sleep 59
c=1
chkdrive
done
if [ $c -eq 1 ]
then
echo "THE DRIVE WAS ASLEEP AND JUST WOKE UP" >> /var/cover${drv}
fi
# These lines remove the automatic Branding lines
sed -e '1d' /var/cover0${drv} > /var/cover1${drv}
sed -e '1d' /var/cover1${drv} > /var/cover0${drv}
sed -e '1d' /var/cover0${drv} > /var/cover1${drv}
sed -e '1d' /var/cover1${drv} > /var/cover0${drv}
cat /var/cover0${drv} >> /var/cover${drv}
exit 0
I think cat all the results together to have simple "PASSED" messages in the email, and then delete any files that are used.
Code:
(
echo "To: email@name.net"
echo "Subject: SMART Drive Results for ${switch1}"
echo " "
) > /var/results
sh /mnt/Storage/scripts/smart.sh /dev/ada0
sh /mnt/Storage/scripts/smart.sh /dev/ada1
sh /mnt/Storage/scripts/smart.sh /dev/ada2
sh /mnt/Storage/scripts/smart.sh /dev/ada3
cat "/dev/ada0" >> /var/results
cat /var/coverada0 >> /var/results
cat /var/coverada1 >> /var/results
cat /var/coverada2 >> /var/results
cat /var/coverada3 >> /var/results
sendmail -t < /var/results
rm /var/results
find /var/cover* -exec rm -rf {} \;
exit 0
I believe all of the dummy and trash files are cleaned up after the second script.
I got an error message once when trying to load the web gui that said /tmp was out of space. I cleared out temp and rebooted, but the issue persists. I would also like to note that it was working fine. And even if I wasnt cleaning up after myself properly it would take a long time for these few lines of text to measure of to 1MB+
I also have reboot several times.
Thanks for your time!