@zabbix简易基础安装步骤

#安装zabbix监控
rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm

yum clean all




#安装Zabbix server 和 agent(代理)

yum install zabbix-server-mysql zabbix-agent




#安装Zabbix frontend (前端平台)

yum install centos-release-scl




#编辑配置文件 /etc/yum.repos.d/zabbix.repo

cat > /etc/yum.repos.d/zabbix.repo << EOF
[zabbix-frontend]
name=repo
baseurl=https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/
enabled=1
gpgcheck=0
EOF




#安装 Zabbix frontend packages

yum install zabbix-web-mysql-scl zabbix-apache-conf-scl




#安装Mysql数据库

cd /usr/local/src/
wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm 
rpm -ivh mysql57-community-release-el7-8.noarch.rpm
yum -y install mysql-server


systemctl start mysqld




 #获取安装时的临时密码
 grep 'temporary password' /var/log/mysqld.log
 



#使用临时密码登录
mysql -uroot -p'临时密码'




#更改密码
mysql> set password=password('Hzl@20144');
Query OK, 0 rows affected, 1 warning (0.00 sec)


 


#创建初始数据库
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
为Zabbix server配置数据库






#编辑配置文件 /etc/zabbix/zabbix_server.conf

vim /etc/zabbix/zabbix_server.conf

DBPassword=Hzl@20144







#为Zabbix前端配置PHP

#编辑配置文件 /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf

vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf

php_value[date.timezone] = Asia/Shanghai






#启动Zabbix server和agent进程,并为它们设置开机自启

systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm

systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm





#打开http:IP/zabbix  
例:http://10.0.0.147/zabbix
posted @ 2021-08-10 20:02  ଲ一笑奈&何  阅读(37)  评论(0编辑  收藏  举报