1.安装zabbix

# 1.关闭selinux
getenforce

# 2.关闭防火墙
systemctl stop    firewalld.service
systemctl disable firewalld.service 

# 3.安装mariadb
yum -y install mariadb-server mariadb-devel

# 4.启动
systemctl start mariadb.service
mysql
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to 'zabbix'@'localhost' identified by '123456';
flush privileges;

# 5.安装zabbix
# http://repo.zabbix.com/zabbix (源链接地址)

wget     http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm
yum makecache
yum search zabbix

QQ截图20180516134638.png

# 6.选择自己需要的安装包进行安装
yum install zabbix-get zabbix-sender zabbix-server-mysql  zabbix-web zabbix-agent

# 7.更新
updatedb

# 8.定位创建语句位置
locate create.sql
-----------------
/usr/share/doc/zabbix-server-mysql-3.2.11/create.sql.gz
-----------------

# 9.解压create.sql.gz文件
cd /usr/share/doc/zabbix-server-mysql-3.2.11
gunzip create.sql.gz
# 10.导入脚本文件
mysql -uroot -p zabbix < create.sql
# 11.修改zabbix_server.conf这个配置文件
locate zabbix_server.conf
-------------------------
/etc/zabbix/zabbix_server.conf
-------------------------

vim /etc/zabbix/zabbix_server.conf
------------------
修改
115 # DBPassword=
为
DBPassword=123456

修改
122 # DBSocket=/tmp/mysql.sock
为
DBSocket=/var/lib/mysql/mysql.sock
------------------

# 12.正常应该有这几个参数
egrep -vn "^#|^$" /etc/zabbix/zabbix_server.conf
----------------------
38 : LogFile=/var/log/zabbix/zabbix_server.log
49 : LogFileSize=0
72 : PidFile=/var/run/zabbix/zabbix_server.pid
91 : DBName=zabbix
107: DBUser=zabbix
115: DBPassword=123456
122: DBSocket=/var/lib/mysql/mysql.sock
287: SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
413: Timeout=4
455: AlertScriptsPath=/usr/lib/zabbix/alertscripts
465: ExternalScripts=/usr/lib/zabbix/externalscripts
501: LogSlowQueries=3000
----------------------

13.修改时区
vim /etc/httpd/conf.d/zabbix.conf
------------------
修改
19         # php_value date.timezone Europe/Riga
为
19         php_value date.timezone Asia/Shanghai
------------------
# 14.开启一些服务
yum install httpd
systemctl start httpd.service
systemctl start mariadb
systemctl start zabbix-server
systemctl start zabbix-agent

# 15.设置开机启动
systemctl enable httpd
systemctl enable mariadb
systemctl enable zabbix-server
systemctl enable zabbix-agent
16.登录进行安装
http://10.1.44.185/zabbix/setup.php


猜你喜欢

转载自blog.51cto.com/13634837/2116916