Create database on PostgreSQL server.

# create database zabbix; # create user zabb_user with password 'qweASD123'; # grant all on database zabbix to zabb_user;


Next, install nginx php71 on Zabbix server.

# pkg ins -y nginx php71 # echo 'nginx_enable="YES"' >> /etc/rc.conf # echo 'php_fpm_enable="YES"' >> /etc.rc.conf


Configure php.

# cd /usr/local/etc # cp php.ini-production php.ini # vi php.ini


upload_max_filesize = 16M max_execution_time=300 max_input_time=300 post_max_size=16M date.timezone = Europe/Moscow


Install zabbix34-server from ports with PostgreSQL support.

# portsnap fetch # portsnap extract # cd /usr/ports/net-mgmt/zabbix34-server # make config-recursive


Check PostgreSQL support and uncheck MySQL support.

# make install clean


Copy sql schemas to postgresql server.

# scp /usr/local/share/zabbix34/server/database/postgresql* pdb1:/root


Import schemas to database.

# psql -U zabb_user zabbix <schema.sql # psql -U zabb_user zabbix < images.sql # psql -U zabb_user zabbix < data.sql


Install zabbix34-frontend from ports on Zabbix server.

# cd /usr/ports/net-mgmt/zabbix34-frontend


Check PostgreSQL driver and uncheck MysQL driver.

# make config-recursive # make install clean


Configure.Zabbix server.

# cp zabbix_server.conf.sample zabbix_server.conf # vi zabbix_server.conf


LogFile=/var/log/zabbix_server.log DBName=zabbix DBUser=zabbuser DBPassword=Пароль DBHost=10.0.1.242 DBPort=5432


Create log.

# touch /var/log/zabbix_server.log # chmod a+w /var/log/zabbix_server.log


Enable and start Zabbix server.

# echo 'zabbix_server_enable="YES"' >> /etc/rc.conf # service zabbix_server start


Configure nginx and php.

# vi /usr/local/etc/nginx.conf


Specify Zabbix frontend location /usr/local/www/zabbix34 and enable php location.
Go to web browser http://10.0.1.150 and finish setup.
Login with user Admin and password zabbix.