Skip to content

Instantly share code, notes, and snippets.

@vlaxa
Created July 23, 2020 04:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vlaxa/3f703d19b822330cf63272d5799549f3 to your computer and use it in GitHub Desktop.
Save vlaxa/3f703d19b822330cf63272d5799549f3 to your computer and use it in GitHub Desktop.
Custom Qnap NAS script to report RAID statistics by email.
#!/bin/bash
touch /tmp/raid-report.txt
echo "Subject: Qnap RAID report" >> /tmp/raid-report.txt
echo "From: qnap@mydomain.com" >> /tmp/raid-report.txt
echo "To: admin@mydomain.com" >> /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