1)查看系统版本
[root@zabbix-s41 ~]# cat /etc/redhat-release CentOS Linux release 7.6.1810 (Core) [root@zabbix-s41 ~]#
2)客户端安装zabbix
1)添加zabbix仓库 rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm 2)安装zabbix-server yum install -y zabbix-server-mysql 3)安装zabbix-font-mysql yum install -y zabbix-web-mysql
3)数据库操作
create database zabbix character set utf8 collate utf8_bin; #创建zabbix数据库 grant all privileges on zabbix.* to zabbix@localhost identified by ‘zabbix‘; #授权zabbix用户从localhost访问,对zabbix数据库有完全控制权限 flush privileges; zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix #初始化数据库结构并导入数据 vim /etc/zabbix/zabbix_server.conf DBHost=localhost DBName=zabbix DBuser=zabbix DBPassword=zabbix #更改时区,让时间同步 vim /etc/httpd/conf.d/zabbix.conf php_value date.timezone Asia/shanghai
4)启动服务
systemctl restart zabbix-server httpd #重启apache 跟zabbix systemctl enable zabbix-server httpd #加入开机启动 #如果启动出错查看日志/var/log/zabbix/server-zabbix-log
5)客户端安装配置
rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm yum install -y zabbix-agent systemctl start zabbix-agent systemctl enable zabbix-agent
6)访问ip/zabbix
原文:https://www.cnblogs.com/liang-io/p/11134057.html