您好,登錄后才能下訂單哦!
https://www.zabbix.com/documentation/4.0/zh/manual
zabbix清華源下載地址:https://mirrors.tuna.tsinghua.edu.cn/zabbix/
1. 下載安裝zabbix的release的rpm包(安裝完后會自動生成zabbix的yum源)
rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
rpm -ql zabbix-release 查看是否安裝成功
/etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
/etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
/etc/yum.repos.d/zabbix.repo
/usr/share/doc/zabbix-release-4.0
/usr/share/doc/zabbix-release-4.0/GPL
2. 替換成清華的yum源(這樣是為了下載速度快)
vim /etc/yum.repos.d/zabbix.repo
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=1
3 .安裝 zabbix-server-mysql zabbix-web-mysql
yum install zabbix-server-mysql yum install zabbix-server-mysql -y
-----------------------------------------
如有報(bào)錯提示
錯誤:軟件包:zabbix-server-mysql-3.0.25-1.el7.x86_64 (zabbix)
需要:libiksemel.so.3()(64bit)
錯誤:軟件包:zabbix-server-mysql-3.0.25-1.el7.x86_64 (zabbix)
需要:fping
----------------------------------------------------------
解決方法:添加epel.repo源
vim /etc/yum.repo/epel.repo
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=http://mirrors.ucloud.cn/epel/7/$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=http://mirrors.ucloud.cn/epel/RPM-GPG-KEY-EPEL-7
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
baseurl=http://mirrors.ucloud.cn/epel/7/$basearch/debug
failovermethod=priority
enabled=0
gpgkey=http://mirrors.ucloud.cn/epel/RPM-GPG-KEY-EPEL-7
gpgcheck=1
[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
baseurl=http://mirrors.ucloud.cn/epel/7/SRPMS
failovermethod=priority
enabled=0
gpgkey=http://mirrors.ucloud.cn/epel/RPM-GPG-KEY-EPEL-7
gpgcheck=1
---------------------------------------------------
如有報(bào)錯:
Error: Package: zabbix-server-mysql-3.4.15-1.el7.x86_64 (zabbix)
Requires: libiksemel.so.3()(64bit)
-----------------------------------
解決方法:
yum install -y http://springdale.math.ias.edu/data/puias/unsupported/7/x86_64/iksemel-1.4-6.sdl7.x86_64.rpm
4、安裝mariadb
yum install mariadb-server -y
#啟動mariadb
systemctl start mariadb
systemctl enable mariadb
#安全初始化數(shù)據(jù)庫
mysql_secure_installation
#輸入root密碼 空格
#設(shè)置root密碼嗎 n
#要移除匿名用戶嗎 y
#取消root遠(yuǎn)程登錄權(quán)限嗎 y
#是否刪除test庫 y
#重置權(quán)限表嗎 y
5、創(chuàng)建zabbix數(shù)據(jù)庫,并把字符集設(shè)置utf8
create database zabbix character set utf8 collate utf8_bin; 創(chuàng)建數(shù)據(jù)庫,設(shè)置utf8
grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix'; 設(shè)置密碼
6、導(dǎo)入初始數(shù)據(jù)到mysql的zabbix用戶的庫里
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -pzabbix zabbix
mysql
use zabbix; 登錄zabbix用戶
show tables; 查詢是否導(dǎo)入成功
7、修改zabbix配置文件
# vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
8、啟動zabbix服務(wù)
systemctl restart zabbix-server
systemctl enable zabbix-server
9、配置zabbix前端(只需要添加一個時區(qū))
vim /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai
10、最后在執(zhí)行安裝一遍需要的服務(wù)
yum isntall httpd php php-mysql mariadb -y
systemctl start httpd
systemctl enable httpd
11、現(xiàn)在zabbix就可以訪問了
*.*.*.*/zabbix
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。