I have Netgear stora NAS with two hard drives.
I have ssh access to it. Probably Debian Linux, I am not so sure.
cat /proc/version Linux version 126.96.36.199-Netgear (firstname.lastname@example.org) (gcc version 4.2.1)
In /var/log/dmes I see that:
md: Autodetecting RAID arrays. md: autorun ... md: created md0
With this command I read hard drives smart information:
/usr/sbin/smartctl --all -d marvell /dev/sda /usr/sbin/smartctl --all -d marvell /dev/sdb
Can you suggest me some linux shell script, which will be added in /etc/crontab to check hard drives state and sends email every week for example?
May be something like this.
subject: NAS state (OK or Warning)
hard drives smart result in plane text or may some part of it
Also I have mdadm in /sbin/, so may be some mdadm script?
/sbin/mdadm -D /dev/md0 /dev/md0: Version : 00.90.03 Creation Time : Thu Feb 15 22:29:29 2018 Raid Level : raid1 Array Size : 1953124928 (1862.65 GiB 2000.00 GB) Used Dev Size : 1953124928 (1862.65 GiB 2000.00 GB) Raid Devices : 2 Total Devices : 2 Preferred Minor : 0 Persistence : Superblock is persistent Update Time : Fri Feb 16 09:48:43 2018 State : active Active Devices : 2 Working Devices : 2 Failed Devices : 0 Spare Devices : 0 UUID : 3e4ce74f:c96e7f85:fd89366b:35810b16 Events : 0.7 Number Major Minor RaidDevice State 0 8 1 0 active sync /dev/sda1 1 8 17 1 active sync /dev/sdb10
How to make script with these status reports, get state OK, Warning, Error and cron it ?
Thanks in advance !
Edited by netaccs, 16 February 2018 - 03:44 AM.