zabbix3.4安装(一)
1.环境准备
环境外网IP | 内网IP | 主机名 |
121.36.10.238 | 192.168.0.101 | Zabbix-agent |
139.9.186.7 | 192.168.0.55 | Zabbix-server |
122.112.164.83 | 192.168.0.42 | Zabbix-mysql |
1.1server安装zabbix
[root@zabbix-server ~]# rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
[root@zabbix-server ~]# yum install -y zabbix-server-mysql zabbix-web-mysql zabbix-agent mariadb-server
1.2启动数据库,创建数据库,配置数据库
[root@zabbix-server ~]# systemctl start mariadb
[root@zabbix-server ~]# systemctl enable mariadb
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
[root@zabbix-server ~]# cd /usr/share/doc/zabbix-server-mysql-3.4.15/
[root@zabbix-server zabbix-server-mysql-3.4.15]# zcat create.sql.gz |mysql -uroot zabbix
1.3启动zabbix进程
[root@zabbix-server zabbix-server-mysql-3.4.15]# grep ^[a-Z] /etc/zabbix/zabbix_server.conf
LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
PidFile=/var/run/zabbix/zabbix_server.pid
SocketDir=/var/run/zabbix
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
Timeout=4
AlertScriptsPath=/usr/lib/zabbix/alertscripts
ExternalScripts=/usr/lib/zabbix/externalscripts
LogSlowQueries=3000
[root@zabbix-server zabbix-server-mysql-3.4.15]# systemctl start zabbix-server
[root@zabbix-server zabbix-server-mysql-3.4.15]# systemctl enable zabbix-server
[root@zabbix-server zabbix-server-mysql-3.4.15]# netstat -lntup|grep 10051
tcp 0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 19956/zabbix_server
tcp6 0 0 :::10051 :::* LISTEN 19956/zabbix_server
1.4修改 /etc/httpd/conf.d/zabbix.conf并启动
[root@zabbix-server zabbix-server-mysql-3.4.15]# vim /etc/httpd/conf.d/zabbix.conf
[root@zabbix-server zabbix-server-mysql-3.4.15]# systemctl start httpd
[root@zabbix-server zabbix-server-mysql-3.4.15]# systemctl enable httpd