环境如下:
zabbix版本:5.0LTS
系统版本:CentOS7
数据库:centos7 默认的 mariadb 数据库
WEB server:nginx
Install and configure Zabbix server for your platform
a. Install Zabbix repository
# rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
# yum clean all
b. Install Zabbix server and agent
# yum install zabbix-server-mysql zabbix-agent
c. Install Zabbix frontend
Enable Red Hat Software Collections
# yum install centos-release-scl
Edit file /etc/yum.repos.d/zabbix.repo and enable zabbix-frontend repository.
[zabbix-frontend]
...
enabled=1
...
Install Zabbix frontend packages.
# yum install zabbix-web-mysql-scl zabbix-nginx-conf-scl
# yum install mariadb-server -y
# systemctl enable --now mariadb
d. Create initial database
Make sure you have database server up and running.
Run the following on your database host.
# mysql -uroot -p
password
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> create user zabbix@localhost identified by 'password';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> quit;
On Zabbix server host import initial schema and data. You will be prompted to enter your newly created password.
# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
e. Configure the database for Zabbix server
Edit file /etc/zabbix/zabbix_server.conf
DBPassword=password
f. Configure PHP for Zabbix frontend
Edit file /etc/opt/rh/rh-nginx116/nginx/conf.d/zabbix.conf, uncomment and set 'listen' and 'server_name' directives.
listen 80;
server_name zabbix.net-7x24.cn;
Edit file /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf, add nginx to listen.acl_users directive.
listen.acl_users = apache,nginx
Then uncomment and set the right timezone for you.
php_value[date.timezone] = Asia/Shanghai
g. Start Zabbix server and agent processes
Start Zabbix server and agent processes and make it start at system boot.
# systemctl restart zabbix-server zabbix-agent rh-nginx116-nginx rh-php72-php-fpm
# systemctl enable zabbix-server zabbix-agent rh-nginx116-nginx rh-php72-php-fpm
H. visit the zabbix install page http://zabbix.net-7x24.cn
登录账号为 Admin,密码:zabbix