zabbix-server 5.0.2 install
2020-08-20Zabbix用户界面也得到了改进,以支持监控和管理数百万受监控设备。
1、安装zabbix 5.0.2
rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm
dnf install zabbix-server-mysql zabbix-web-mysql zabbix-nginx-conf zabbix-agent
2、安装php7.3
dnf install dnf-utils http://rpms.remirepo.net/enterprise/remi-release-8.rpm
dnf module reset php
dnf module enable php:remi-7.3
#默认设置为remi-7.3版本
yum -y install php php-mysqlnd php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc php-zip
vi /etc/php.ini
post_max_size = 16M
max_execution_time = 300
max_input_time = 300
date.timezone =Asia/Shanghai
vi /etc/php-fpm.conf
user = www
group = www
listen = 127.0.0.1:9002
pm.max_children = 200
pm.start_servers = 10
pm.min_spare_servers = 10
pm.max_spare_servers = 90
3、安装mysql8
yum -y install mysql-server mysql
systemctl start mysqld
pw=$(cat /var/log/mysqld.log|grep root|awk '{print $NF}')
export MYSQL_PWD='06(s7dI=2XHy'
mysql --connect-expired-password -uroot -Dmysql -e"alter USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'item-123456';"
mysql --connect-expired-password -uroot -Dmysql -e"FLUSH PRIVILEGES;"
4、创建数据库
mysql -uroot -ppassword
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'password';
mysql> quit;
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
5、cp /usr/share/zabbix/conf/zabbix.conf.php.example /etc/zabbix/web/zabbix.conf.php
chown -R www.www /etc/zabbix
$DB['TYPE'] = 'MYSQL';
$DB['SERVER'] = '172.16.2.1';
$DB['PORT'] = '3306';
$DB['DATABASE'] = 'zabbixdb';
$DB['USER'] = 'zabbixuser';
$DB['PASSWORD'] = 'db123456';
6、nginx配置
listen 80;
server_name zabbix.wallcopper.com;
root /usr/share/zabbix;
index index.php index.htm index.html;
#include proxy.conf;
}
root /usr/share/zabbix;
fastcgi_pass 127.0.0.1:9002;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}