1.check install environment
[root@VM_0_7_centos ~]# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
2.close firewall and selinux
systemctl stop firewalld.service
systemctl disable firewalld.service
[root@VM_0_7_centos ~]# grep SELINUX=disabled /etc/selinux/config
SELINUX=disabled
3.install mariadb
yum install mariadb-server mariadb –y
systemctl start mariadb
systemctl stop mariadb
systemctl restart mariadb
systemctl enable mariadb
4.download zabbix 3.4
wget http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
rpm -ivh zabbix-release-3.4-2.el7.noarch.rpm
yum install zabbix-server-mysql zabbix-web-mysql
yum install zabbix-agent
5.creat datebase
[root@VM_0_7_centos ~]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 5.5.56-MariaDB MariaDB Server
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
MariaDB [(none)]> exit
6.import data
[root@VM_0_7_centos ~]# cd /usr/share/doc/zabbix-server-mysql-3.4.8/
[root@VM_0_7_centos zabbix-server-mysql-3.4.8]# ls
AUTHORS ChangeLog COPYING create.sql.gz NEWS README
[root@VM_0_7_centos zabbix-server-mysql-3.4.8]# cd
[root@VM_0_7_centos ~]# zcat /usr/share/doc/zabbix-server-mysql-3.4.8/create.sql.gz | mysql -uzabbix -pzabbix zabbix
[root@VM_0_7_centos ~]#
7.check database user infomation
[root@VM_0_7_centos ~]# grep -n '^'[a-Z] /etc/zabbix/zabbix_server.conf
38:LogFile=/var/log/zabbix/zabbix_server.log
49:LogFileSize=0
72:PidFile=/var/run/zabbix/zabbix_server.pid
82:SocketDir=/var/run/zabbix
101:DBName=zabbix
117:DBUser=zabbix
330:SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
448:Timeout=4
490:AlertScriptsPath=/usr/lib/zabbix/alertscripts
500:ExternalScripts=/usr/lib/zabbix/externalscripts
536:LogSlowQueries=3000
8.add DBPassword infomation
[root@VM_0_7_centos ~]# vim /etc/zabbix/zabbix_server.conf
DBPassword=zabbix
9.start zabbix-server service and setup starting up
[root@VM_0_7_centos ~]# systemctl start zabbix-server
[root@VM_0_7_centos ~]# systemctl enable zabbix-server
Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-server.service to /usr/lib/systemd/system/zabbix-server.service.
10.change timezone Asia/Shanghai
[root@VM_0_7_centos ~]# vim /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai
11.start httpd service and setup starting up
[root@VM_0_7_centos ~]# systemctl start httpd
[root@VM_0_7_centos ~]# systemctl enable httpd
Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.
12.browser access and install
修改User:zabbix 设置Password:zabbix
安装完成,在/etc/zabbix/web/zabbix.conf.php生成配置文件
默认登录Admin/zabbix
13.install zabbix-agent
download file
[root@VM_0_7_centos ~]# wget http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-agent-3.4.8-1.el7.x86_64.rpm
[root@VM_0_7_centos ~]# rpm -ivh zabbix-agent-3.4.8-1.el7.x86_64.rpm
modify configuration file,change Server/ServerActive for client server ip
[root@VM_0_7_centos ~]# vim /etc/zabbix/zabbix_agentd.conf
Server=111.231.108.211
ServerActive=111.231.108.211
[root@VM_0_7_centos ~]# systemctl restart zabbix-agent.service
[root@VM_0_7_centos ~]# systemctl enable zabbix-agent.service
Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-agent.service to /usr/lib/systemd/system/zabbix-agent.service.