5. Ensure that MySQL Server is up and running before proceeding this steps. You will be prompted to create a password, proceed to create the password.
$ sudo mysql -uroot -p
password
mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
mysql> create user zabbix@localhost identified by 'password';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> set global log_bin_trust_function_creators = 1;
mysql> quit;
6. Import the Zabbix database schema into MySQL database. You will be prompted to key-in MySQL password. Depending on your system, it may a while to complete.
$ sudo zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
7. Once completed, disabled back the log_bin_trust_function option.
$ sudo mysql -uroot -p
password
mysql> set global log_bin_trust_function_creators = 0;
mysql> quit;
8. Configure Zabbix server to access the database.
$ sudo nano /etc/zabbix/zabbix_server.conf
DBPassword=password
9. Restart and Enabled both Zabbix and Apache2 services.
Building your own NAS (Network Attached Storage) is very easy and simple with TrueNAS. It supports a wide variety of hardware thus making it simple and easy to install.
You can make use of any old computer with at least 4GB or more and a minimum of 4 Hard Drives with any make or model, preferably with the same capacity (eg. 1TB). The performance of system will solely depends on your choice of hardware but for Home use it is more than sufficient.
There are 2 Community Edition available :-
TrueNAS Core
TrueNAS Scale
TrueNAS Core is based on BSD (Berkeley Software Distribution), it's very robust and stable.
TrueNAS Scale on the other hand is based on Debian Linux, it's also very stable and more suitable for Home use because it's using Debian Package.
While TrueNAS Enterprise is more designed towards Enterprise companies with demands on High Availability, High Performance and Professional Supports. iX System also developed and sell pre-build TrueNAS System to cater for anyone that doesn't want to build their own.
Well first of all, TrueNAS is using OpenZFS. It's an Open Source Storage Platform that have functionality of both traditional file system and volume manager.
Unlike other Array Controller that required all hard drives to be in the same Make and Model, OpenZFS make use of mixed Make and Model to create a Storage "Pool" thus making it very suitable for Home use because not everyone have the same hard drive specifications laying around.
2. Use any preferred ISO Maker/Writer to an external USB Flash Drive, a minimum of 8GB will be sufficient.
3. Once the USB Flash Drive is ready, you can plug into the computer.
4. But before installation, we need to ensure that all the hard drive is correctly detected and remove any RAID array configuration. ZFS works best without any RAID configured.
5. You will need to choose the install drive, any capacity drive will do. Preferably the first drive that is connected.
6. After that, you will be prompted to specify an Administrator's password, this password will be used to login to TrueNAS Web GUI on the later stage.
7. Once the installation completed and computer rebooted, on another computer and open your prefer browser (eg. Google Chrome) and type-in the IP Address of the server displayed at console screen.
8. Some basic configurations is required, we need to specify a Static IP Address for the server. This will ensure that everytime the server rebooted, it will use the same IP Address and also it is more easy to configure port forwarding in your router (if needed) for some applications to work.
9. Next is to create the first storage pool, you can configure as many pool(s) you want but all depends on the available hard drives. For example, ZFS-z required a minimum of 2 drives (similarly to RAID-1), if you have more than 2 hard drives (eg. 3 drives) then the additional hard drive will be used as Parity Drive which are similarly to RAID-5.
10. Now you TrueNAS will work correctly, further configuration is required such as creating SMB (Samaba) Shares, NFS Share or whichever you required.
This is an example of a batch file to rename the Hostname or Computer Name as per your preferences, it is much faster way to do computer renaming for many computers.
Note that the batch file must be "run as administrator" mode in order to works.
@ECHO OFF
CLS
>NUL CHCP 65001
:asktorename
REM To ask whether to Rename the Hostname or not.
ECHO.
ECHO.
ECHO.
ECHO ╔═════════════════════════════════════════╗
ECHO ║ RENAMING THE HOSTNAME ║
ECHO ╚═════════════════════════════════════════╝
ECHO.
CHOICE /M "──────────────► DO YOU WANT TO RENAME THE HOSTNAME "
IF ERRORLEVEL 2 GOTO eof
IF ERRORLEVEL 1 GOTO askforname
GOTO eof
REM --------------------------------------------------------------------------------------
:askforname
REM To ask User for the preferred hostname.
ECHO.
ECHO.
SET /P NEWNAME="PLEASE TYPE THE NEW HOSTNAME: "
ECHO.
ECHO " ► ► ► THE NEW HOSTNAME IS ───► %NEWNAME%"
CHOICE /M " ► ► ► IS THIS CORRECT "
IF ERRORLEVEL 2 GOTO asktorename
IF ERRORLEVEL 1 GOTO dorenhost
GOTO eof
REM --------------------------------------------------------------------------------------
:dorenhost
REM To proceed Rename the Hostname as per Input by User.