selinux setenforce 0
selinux sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
systemctl stop firewalld.service
systemctl disable firewalld.service
#server
rpm -ivh http://repo.zabbix.com/zabbix/4.1/rhel/7/x86_64/zabbix-release-4.1-1.el7.noarch.rpm
yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-get
#数据库
# 创建zabbix用户和库
create database zabbix ;
grant all on zabbix.* to 'zabbix'@'%' identified by "zabbix";
#导入zabbix表结构和初始数据
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p'zabbix' zabbix
#服务端配置
/etc/zabbix/zabbix_server.conf
DBPassword=zabbix
# 添加上海区 sed -i.ori '19a php_value date.timezone Asia/Shanghai' /etc/httpd/conf.d/zabbix.conf
# 解决图形列表下中文乱码
yum -y install wqy-microhei-fonts
mv /usr/share/fonts/dejavu/DejaVuSans.ttf /usr/share/fonts/dejavu/DejaVuSans.ttf.bak
cp -f /usr/share/fonts/wqy-microhei/wqy-microhei.ttc /usr/share/fonts/dejavu/DejaVuSans.ttf
#启动和开机自启
systemctl start zabbix-server httpd
systemctl enable zabbix-server httpd
#URL 请求
http://192.168.181.135/zabbix
#检测和配置zabbix数据库连接IP,端口 zabbix zabbix zabbix
#服务端请求IP和端口默认10051
#配置存储在
/etc/zabbix/web/zabbix.conf.php
#登录
Admin/zabbix
#监控本机
yum -y install zabbix-agent
#本机配置不用修改
/etc/zabbix/zabbix_agentd.conf
# 启动zabbix客户端
systemctl start zabbix-agent
# 开机启动
systemctl enable zabbix-agent