关闭SeLinux
setenforce 0
永久关闭:
vi /etc/selinux/config
关闭防火墙
systemctl stop firewalld.service
注:当然也可以打开指定端口
安装环境
LAMP
# 安装apache yum install -y httpd # httpd服务开机进行自启 systemctl enable httpd # 启动httpd服务 systemctl start httpd
zabbix要将数据存入数据库,所以要安装Mysql :
https://blog.csdn.net/qq_43059674/article/details/100729776#_mySql_174
安装zabbix存储库
# yum clean all # rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
安装zabbix zabbix-server-mysql zabbix-web-mysql zabbix-agent
yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent
创建初始数据库
# mysql -uroot -p password mysql> create database zabbix character set utf8 collate utf8_bin; mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix'; mysql> quit;
导入sql脚本到zabbix数据库中
cd /usr/share/doc/zabbix-server-mysql-4.0.13
解压:
gunzip create.sql.gz
登录mysql
mysql -u root -p # 输入密码即可
切换数据
use zabbix
导入sql
source create.sql
退出
quit;
为zabbix服务器配置数据库
vi /etc/zabbix/zabbix_server.conf
DBPassword=zabbix
编辑 /etc/httpd/conf/zabbix.conf,取消注释并为设置正确的时区。
vi /etc/httpd/conf.d/zabbix.conf
配置时间
php_value date.timezone Asia/Shanghai
启动
# systemctl restart zabbix-server zabbix-agent httpd # systemctl enable zabbix-server zabbix-agent httpd
登陆zabbix网址设置
192.168.43.161/zabbix/
mysql连接配置:
设置服务名: