1 提要
1、本次server版本为3.2.11,agent版本为3.2.11、3.2.7、3.0.17等(根据系统自选)
2、本次server运行环境为Linux7.2+集成工具xampp- 7.0.29(Apache + MariaDB + PHP + Perl)
3、本次agent例子有linux7.2、Linux6.2和Windows7
2 部署server服务器
以下以192.168.25.128(Linux7.2)为例
前提:已获取zabbix源码和xampp安装包。本次安装使用zabbix-3.2.11.tar; xampp-linux-x64-7.0.29-0-installer.run
2.1 安装xampp
2.1.1 安装xampp
1、运行安装包:
./xampp-linux-x64-7.0.29-0-installer.run
2、启动xampp
/opt/lampp/lampp start
2.1.2 修改MySQL(mariaDB)的密码
按照红色字体的命令输入即可:
[root@localhost ~]# /opt/lampp/bin/mysql -uroot Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> use mysql MariaDB [mysql]> flush privileges; |
2.2 安装zabbix
2.2.1 准备gcc编译环境
安装所需的依赖包即可:
yum install gcc gcc-c++ autoconf automake zlib zlib-devel openssl openssl-devel pcre pcre-devel -y
2.2.2 selinux和防火墙处理
1.处理selinux:
1.1:修改/etc/selinux/config 进入配置文件 设置:SELINUX=disabled(重启才生效)
1.2:临时关闭selinux:setenforce 0
2.关闭防火墙:
systemctl stop firewalld.service
2.2.3 zabbix编译安装
1)解压zabbix安装包,进入zabbix源码目录,执行下面命令
[root@localhost ~]# ./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2
备注:
--prefix=/usr/local/zabbix 本次安装的路径
--enable-server --enable-agent表示即安装server也安装agent
2)执行完上述命令后,执行下面命令编译安装zabbix
[root@localhost ~]# make&&make install
2.2.4 导入zabbix默认数据库
1、连接数据库:
[root@localhost ~]# mysql -uroot -p