NETGEAR is aware of a growing number of phone and online scams. To learn how to stay safe click here.
Forum Discussion
alaeth
Nov 11, 2013Aspirant
Earlier failure detection of disks?
It seems that every time I have a failed drive, I discover the failure in one of two ways: 1. I'm in the wiring closet and see the OLED panel lit up and investigate - seeing the "Vol C: is unprotecte...
alaeth
Nov 12, 2013Aspirant
fastfwd, you make a good argument. I shall call them when I'm back in town and in front of the device.
In the meantime, I have (what I hope is) a much more robust solution than the default.
Inspired by this post:
http://community.spiceworks.com/scripts ... t-rollover
I've whipped up the following script that runs a a cron job every hour:
The beauty of this script is I can customize it to email me whenever anything interesting occurs in the syslog.
In the meantime, I have (what I hope is) a much more robust solution than the default.
Inspired by this post:
http://community.spiceworks.com/scripts ... t-rollover
I've whipped up the following script that runs a a cron job every hour:
#!/bin/bash
# This is a script that will grep a log file and send an email when a specified patter is encountered.
# Original Author: Salman Bayat
# http://community.spiceworks.com/scripts/show/225-email-notifications-gernerated-via-monitoring-of-logs-that-rollover
#
errors=$(grep -wE ' Disk failure on sd[a-g][0-6], disabling device.|SMART' /var/log/syslog)
#errors=$(grep "System Error Pattern Here" /var/log/yourlogfilehere.log)
echo "${errors}" > /tmp/current-errors.log
if [ -e "/tmp/prior-errors.log" ]; then
echo "prior-errors.log Exists" > /dev/null
else
touch /tmp/prior-errors.log | echo "" > /tmp/prior-errors.log
fi
newentries=$(diff --suppress-common-lines -u /tmp/prior-errors.log /tmp/current-errors.log | grep '\+[0-9]')
if
test "$newentries" != "" && test "$errors" = ""
then
echo "No New Errors" > /dev/null
elif
test "$newentries" != ""
then
echo -e "To: ADMIN\nFrom: READYNAS\nSubject: new SYSLOG events detected!\n\nThe following syslog errors have been detected matching your alert pattern:\n\n${errors}" | /usr/sbin/sendmail <my_email_address>
echo "$errors" > /tmp/prior-errors.log
fi
The beauty of this script is I can customize it to email me whenever anything interesting occurs in the syslog.
Related Content
NETGEAR Academy

Boost your skills with the Netgear Academy - Get trained, certified and stay ahead with the latest Netgear technology!
Join Us!