Zabbix安裝與部署
1 Zabbix的安裝
1.1 關(guān)閉SeLinux
[root@localhost ~]# setenforce 0
setenforce: SELinux is disabled
# 查看配置文件
[root@localhost ~]# cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled # 設(shè)置為disabled
# SELINUXTYPE= can take one of three two values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
1.2 關(guān)閉防火墻
1.2.1 臨時關(guān)閉
systemctl stop firewalld.service
1.2.2 永久關(guān)閉
systemctl disable firewalld.service
1.3 安裝MySQL
因為是測試環(huán)境下暴匠,所以我們可以使用mariadb,主要是為了方便快捷
yum install -y mariadb mariadb-server
開機(jī)自啟動
Systemctl enable mariadb
運行服務(wù)
Systemctl start mariadb.service
Systemctl status mariadb.service
1.4 安裝zabbix
安裝步驟:
下載包
安裝包
創(chuàng)建數(shù)據(jù)庫
創(chuàng)建賬戶并且授權(quán)設(shè)置密碼
導(dǎo)入數(shù)據(jù)表結(jié)構(gòu)
配置
zabbix server
配置文件運行
zabbix-server
服務(wù)
1.4.1 下載包
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
注意:在下載過程中會存在 zabbix-server-mysql
和 zabbix-web
下載不下來的情況佑力,請排查是由于網(wǎng)絡(luò),如果出現(xiàn)timeout...
等的情況
1.4.2 安裝zabbix包
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
1.4.3 安裝zabbix的包
yum install -y zabbix-server-mysql zabbix-get zabbix-web zabbix-web-mysql zabbix-agent zabbix-sender
1.4.4 創(chuàng)建一個zabbix庫并設(shè)置為utf8的字符編碼格式
create database zabbix character set utf8 collate utf8_bin;
創(chuàng)建賬戶并且授權(quán)設(shè)置密碼
grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
如果報錯:報錯信息為
如果報錯:Your password does not satisfy the current policy requirements
set global validate_password_policy=0;
set global validate_password_length=1;
quit
1.4.5 導(dǎo)入數(shù)據(jù)
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
注意:
注:如果還讓輸入密碼磁滚,就再輸入一遍暖侨,默認(rèn)密碼:zabbix
導(dǎo)入數(shù)據(jù)時,可能會出現(xiàn)終端卡頓現(xiàn)象你辣,不要著急眷细,多等待一會就好
1.4.6 配置zabbix server配置文件
文件位置:/etc/zabbix/zabbix_server.conf
修改數(shù)據(jù):
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
1.4.7 啟動zabbix-server服務(wù)
systemctl start zabbix-server.service
# 開機(jī)自啟動zabbix-server服務(wù)
systemctl enable zabbix-server.service
1.4.8 配置PHP
# 配置文件位置
vi /etc/httpd/conf.d
# 修改配置文件
# php_value data.timezone Europe/Riga
php_value data.timezone Asia/Shanghai
# 重啟httpd服務(wù)
Systemctl restart httpd
1.4.9 進(jìn)入zabbix前端頁面
- 打開瀏覽器 :
服務(wù)器主機(jī)ip/zabbix
wps1.jpeg
wps1.jpeg
wps2.jpeg
wps2.jpeg
wps3.jpeg
wps3.jpeg
wps4.jpeg
wps4.jpeg
wps5.jpeg
wps5.jpeg
wps6.jpeg
wps6.jpeg
wps7.jpeg
wps7.jpeg
wps8.jpeg
wps8.jpeg
wps9.jpeg
wps9.jpeg
wps10.jpeg
本文參考鏈接