一、环境:
[root@backup ~]# cat /etc/redhat-release
CentOS release 6.9 (Final)
[root@backup ~]# uname -r
2.6.32-696.el6.x86_64
nginx版本: 1.10.2
php版本: 5.5.3
zabbix版本:3.0.14
二、主机分配:
数据库: 10.0.0.114 172.16.1.114 (主机名:mysql )
zabbix_server: 10.0.0.115 172.16.1.115 (主机名:backup )
三、zabbix安装:
01 解决依赖
yum install net-snmp-devel mysql-devel -y
02 下载zabbix-3.0.14.tar.gz软件
官方下载地址:https://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.0.14/zabbix-3.0.14.tar.gz
tar xf zabbix-3.0.14.tar.gz
cd zabbix-3.0.14/
./configure --prefix=/application/zabbix-3.0.14 --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2
make && make install
ln -s zabbix-3.0.14 zabbix
03 数据库创库授权并导入数据(注意顺序):
/application/mysql/bin/mysql -uroot -p<password>
create database zabbix charset utf8;
grant all on zabbix.* to zabbix@'172.16.1.0/24' identified by 'zabbix';
/application/mysql/bin/mysql -uroot -poldboy123 zabbix < schema.sql
/application/mysql/bin/mysql -uroot -poldboy123 zabbix < images.sql
/application/mysql/bin/mysql -uroot -poldboy123 zabbix < data.sql
04 配置文件修改
vim zabbix_server.conf #全部内容如下
LogFile=/tmp/zabbix_server.log
DBName=zabbix
DBUser=zabbix
Timeout=4
LogSlowQueries=3000
DBPassword=zabbix
DBHost=172.16.1.114
ListenIP=10.0.0.115
AlertScriptsPath=/application/zabbix-3.0.14/share/zabbix/alertscripts
vim zabbix_agentd.conf #全部内容如下:
LogFile=/tmp/zabbix_agentd.log
Server=127.0.0.1
ServerActive=127.0.0.1
Hostname=backup
05 web环境:
cp -a /server/tools/zabbix-3.0.14/frontends/php/* /application/nginx/html/
06 启动和关闭
启动:/application/zabbix/sbin/zabbix_server
关闭:ps -ef|grep zabbix
kill +id
07 登录web页面:http://10.0.0.115/
08 说明:若在web界面出现php有关配置出错,请自行修改php.ini文件。