I/O error text message notification

by on Dec.31, 2016, under Code, Posts

Recently a good friend be-gifted me Banana PI M3 for my birthday. I decided to turn it into a NAS. Granted it is no Synology NAS but it gets the job done and openmediavault is a wonderful software suite to use on it. I thought to myself, “It would be nice to get a notification if there are any I/O errors via dmesg on my homemade NAS. So I whipped up a simple solution:

vim /bin/ioerrorcontact

#!/bin/bash

if dmesg | fgrep ‘I/O error’ &> /dev/null;
then
curl http://textbelt.com/text -d number=MyPhoneNumber -d message=”I/O Error on your NAS” &> /dev/null;
fi

crontab -e

0 * * * *       bash /bin/ioerrorcontact

This is just a quick and simple hack but it’s peace of mind knowing that I have something in place to notify me if my simple NAS is having any issues, especially since I do not have RAID 1 configured on it. RAID 1 via BananaPi or really any other Pi devices at this point isn’t really that great because you would have the split one SATA channel/bandwidth to be able to get it to work. I also strongly recommend that if you’re going to build a low powered NAS device using a Pi device, to use the BananaPi because it has gigabit Ethernet. Other than that, if you have the money to shell out and want a better solution, I recommend Synology NAS products.

#Update 4/14/2017

Textbelt.com now requires a key parameter and is no longer ‘free’:

:, , , , , , ,

Leave a Reply

Please leave these two fields as-is:

Protected by Invisible Defender.

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!