Created
July 23, 2020 04:51
-
-
Save vlaxa/3f703d19b822330cf63272d5799549f3 to your computer and use it in GitHub Desktop.
Custom Qnap NAS script to report RAID statistics by email.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
touch /tmp/raid-report.txt | |
echo "Subject: Qnap RAID report" >> /tmp/raid-report.txt | |
echo "From: [email protected]" >> /tmp/raid-report.txt | |
echo "To: [email protected]" >> /tmp/raid-report.txt | |
echo "" >> /tmp/raid-report.txt | |
echo "RAID log" >> /tmp/raid-report.txt | |
echo "==================================" >> /tmp/raid-report.txt | |
mdadm --query --detail /dev/md2 >> /tmp/raid-report.txt | |
cat /tmp/raid-report.txt | sendmail -t | |
rm /tmp/raid-report.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment