These scripts are based on FreeNAS forums user Bidule0hm scripts which are themselves based on FreeNAS forums user joeschmuck scripts and FreeNAS forums user titan_rw scripts. Though I still did a lot of work, like rewriting large parts of them and doing some overall code cleaning.
This is a collection of useful scripts for FreeNAS admins that want to have more reporting than just what's included in the OS, display useful information like HDD and CPU temperature easily in a terminal and scripting the backup of the FreeNAS config.
- Change how SMART and zpool reports are displayed in order to use native HTML tables.
- Take some ideas from Spearfoot FreeNAS scripts, in particular the encryption (but using GPG instead of a symetric algorithm like AES256) and sending of a correctly MIME-formated config backup as an email attachment.
- Add GitHub actions to lint the scripts.
- FreeNAS (tested with version 11.2+)
git clone https://github.com/PlqnK/freenas-useful-scripts.git
cd freenas-useful-scripts
for file in *.example*; do cp $file $(echo $file | sed -e 's/.example//'); done
You then need to adapt the variables in the user.conf
file according to your setup and needs.
Next, set the scripts as executable:
find . -type f -name "*.sh" -exec chmod +x {} \;
Finally you will need to create cron jobs in the FreeNAS WebUI in order to execute the reporting and backup script on a schedule. The FreeNAS documentation explains how to do it. The command to execute should be:
cd /path/to/the/script && ./script.sh
Otherwise the sourcing of the .conf
files that happens at the beginning of each script will fail.
Contributions in the form of issues or PR are welcome if you see any area of improvement or if you have new ideas for useful scripts!
This project is following Google Shell style guidelines and translate-shell AWK style guidelines but I prefer to keep AWK usage to a minimum, only when there's no really usable bash alternative.
This project is released under the BSD 3-Clause License. A copy of the license is available in this project folder.