1、安装lamp环境
 [root@localhost software]# yum -y install mariadb mariadb-server httpd php php-mysql
 [root@localhost software]# systemctl enable httpd
 [root@localhost software]# systemctl restart htpd
 [root@localhost software]# systemctl restart httpd
 [root@localhost software]# systemctl enable mariadb
 [root@localhost software]# systemctl restart mariadb
 [root@localhost software]# mysql_secure_installation #初始化mariadb数据库
 直接回车
 Y
 pwd@123
 pwd@123
 Y
 Y
 Y
 Y
 [root@localhost software]# mysql -uroot -p #进入mariadb数据库
 exit #退出mariadb数据库
 2、Zabbix安装
 [root@localhost software]# rpm -ivh zabbix-release-3.2-1.el7.noarch.rpm
 [root@localhost software]# rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX #导入秘钥
 [root@localhost ~]# yum clean all
 Cleaning repos: base extras updates zabbix zabbix-non-supported
 Other repos take up 43 M of disk space (use --verbose for details)
 [root@localhost ~]# yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent
 3、初始化数据库
 [root@localhost ~]# mysql -uroot -p
 create DATABASE zabbix DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; #创建数据库(区分大小写)
 grant all privileges on zabbix.* to zabbix@localhost identified by ‘pwd@123’; #设置zabbix用户和密码对数据库的使用权
 exit
 读入数据库:
 cd /usr/share/doc/zabbix-server-mysql-3.2.11/
 zcat create.sql.gz | mysql -uroot -p zabbix
 4、读入数据库
 [root@localhost ~]# cd /usr/share/doc/zabbix-server-mysql-3.2.11/
 [root@localhost zabbix-server-mysql-3.2.11]# ls
 AUTHORS ChangeLog COPYING create.sql.gz NEWS README
 [root@localhost zabbix-server-mysql-3.2.11]# zcat create.sql.gz | mysql -uroot -p zabbix #还原数据库
 [root@localhost zabbix-server-mysql-3.2.11]# mysql -uroot -p
 MariaDB [(none)]> use zabbix
 MariaDB [zabbix]> show tables;
 5、启动zabbix服务
 [root@localhost zabbix-server-mysql-3.2.11]# vim /etc/zabbix/zabbix_server.conf
 DBHost=localhost
 DBUser=zabbix
 DBPassword=pwd@123
 [root@localhost zabbix-server-mysql-3.2.11]# systemctl start zabbix-server
 [root@localhost zabbix-server-mysql-3.2.11]# systemctl enable zabbix-server
 6、编辑zabbix前段php配置
 [root@localhost zabbix-server-mysql-3.2.11]# vi /etc/httpd/conf.d/zabbix.conf #更改时区为上海时区
[root@localhost zabbix-server-mysql-3.2.11]# systemctl restart httpd #因为修改了php,目前是lamp的环境,所以需要重启apache
 7、调整时间同步ntp
 [root@localhost zabbix-server-mysql-3.2.11]# yum -y install ntpdate
 [root@localhost zabbix-server-mysql-3.2.11]# ntpdate 11.11.31.253
 [root@localhost zabbix-server-mysql-3.2.11]# systemctl restart httpd
 8、调整zabbix访问路径
 [root@localhost zabbix]# vi /etc/httpd/conf/httpd.conf 修改apache的主配置文件
9、调整php时区
 [root@localhost zabbix]# vi /etc/php.ini
10、访问zabbix
 访问地址:zabbix服务器ip地址
 Mysql数据库端口是3306
 网页登录用户名:Admin,密码:zabbix
 11、修改页面为中文展示
再刷新页面即可
 12、监控本机,部署agent
 (1)安装部署agnet
 [root@localhost zabbix]# vi /etc/zabbix/zabbix_agentd.conf
 [root@localhost zabbix]# systemctl start zabbix-agent
 [root@localhost zabbix]# systemctl enable zabbix-agent
[root@localhost zabbix]# netstat -anpt | grep 10050 #检测是否启动,10050是agent端口
 tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 9652/zabbix_agentd
 tcp6 0 0 :::10050 ::😗 LISTEN 9652/zabbix_agentd
 (2)页面添加对agnet所在节点的监测
 首先将此停用的主机删除即可
创建主机
(3)修改默认字符集
 在本机“运行”中输入“fonts”,取任意字体,如msyh.ttc
 将msyh.ttc放入“/usr/share/zabbix/fonts/”路径下
 [root@localhost fonts]# chmod a+x msyh.ttc #赋予msyh.ttc权限
 [root@localhost fonts]# vi /usr/share/zabbix/include/defines.inc.php #修改默认字体配置
修改后,因为是php,所以不需要重启