Skip to content

A collection of scripts for TrueNAS to display useful information, do some reporting by email and backup the TrueNAS config.

License

Notifications You must be signed in to change notification settings

PlqnK/truenas-useful-scripts

Repository files navigation

FreeNAS Useful Scripts

Disclaimer

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.

About the project

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.

Roadmap

  • 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.

Prerequisites

  • FreeNAS (tested with version 11.2+)

Installation

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.

Contributing

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.

License

This project is released under the BSD 3-Clause License. A copy of the license is available in this project folder.

About

A collection of scripts for TrueNAS to display useful information, do some reporting by email and backup the TrueNAS config.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages