# 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
# 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