前置操作
1、關閉防火墻
systemctl stop firewalld
systemctl disable firewalld
2、關閉selinx
setenforce 0
附:查看selinux的命令及永久關閉selinux
getenforce
vi /etc/sysconfig/selinux
SELINUX=enforcing 改為 SELINUX=disabled
3、添加域名解析
在/etc/hosts當中添加一條記錄(主機ip地址加域名)
192.168.1.5 zabbix.server
一、基礎配置
1、使用某里巴巴的鏡像源來加速操作系統的軟件包安裝
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
2、安裝epel-release源(包含了基礎鏡像不包含的工具包)
yum groups install epel-release
3、安裝常用開發組件development tool
yum groups install "Development Tools"
附:查看Development Tool 包含的工具包命令(yum groups info “Development Tools")
4、添加zabbix的鏡像源
rpm -ivh https://repo.zabbix.com/zabbix/4 ... .0-1.el7.noarch.rpm
5、重啟
reboot
二、安裝zabbix-server及相關rpm包
1、安裝zabbix-server-mysql(服務端)
yum install zabbix-server-mysql
2、安裝zabbix-web-mysql(前端)
yum install zabbix-web-mysql
3、安裝mariadb-server(數據庫服務)
yum install mariadb-server
三、初始化mariadb-server
1、啟動mariadb
systemctl start mariadb
附:查看mariadb的狀態、進程、自啟動
systemctl status mariadb
ps aux | grep mysqlchkconfig mariadb on2、初始化mariadb
mysql_secure_installation
(1)Enter current password for root (enter for none): 回車鍵
(2)Set root password? [Y/n] (設置root密碼):n
(3)Remove anonymous users? [Y/n] 是否移除匿名用戶:y
(4)Disallow root login remotely? [Y/n] 是否禁止root登陸:n
(5)Remove test database and access to it? [Y/n]是否刪除測試數據庫:y
(6)Reload privilege tables now? [Y/n]是否重新加載權限:y
四、創建數據庫zabbix
1、進入數據庫
mysql -uroot -p
Enter password: 回車鍵
2、創建數據庫zabbix,字符集為utf8
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
附:顯示數據庫zabbix
MariaDB [(none)]>show databases;
3、授予用戶localhost密碼findsec123在數據庫zabbix上所有權限
MariaDB [(none)]>grant all privileges on zabbix. to zabbix@localhost identified by 'zabbix@findsec123';
4、更新權限表
MariaDB [(none)]> flush privileges;
5、退出數據庫
MariaDB [(none)]> quit;
6、導入數據結構
zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql -uzabbix -pzabbix@findsec123 zabbix
附:查看導入的表
(1)進入數據庫
mysql -uroot -p
(2)使用數據庫zabbix
MariaDB [(none)]> use zabbix;
(3)顯示數據庫zabbix中的表
MariaDB [zabbix]> show tables;
五、修改zabbix-server的配置文件
vi /etc/zabbix/zabbix_server.confDBHost=localhost(數據庫主機名=本地主機)
DBName=zabbix(數據庫名=zabbix)
DBUser=zabbix(數據庫用戶名=zabbix)
DBPassword=zabbix@findsec123(數據庫密碼)
br/>DBHost=localhost(數據庫主機名=本地主機)
DBName=zabbix(數據庫名=zabbix)
DBUser=zabbix(數據庫用戶名=zabbix)
DBPassword=zabbix@findsec123(數據庫密碼)
(1)啟動zabbix-server服務
systemctl start zabbix-server
(2)查看zabbix-server狀態
systemctl status zabbix-server
(3)查看日志
cat /var/log/zabbix/zabbix_server.log
六、配置Zabbix 前端
vi /etc/php.ini
max_execution_time = 300(每個腳本的最長執行時間)
memory_limit = 128M(腳本占用的最大內存)
post_max_size = 16M(php將接受的post數據的最大值)
upload_max_filesize = 2M(上傳文件最大值)
max_input_time = 300(每個腳本用于分析請求數據的最長時間)
max_input_vars = 10000(可以接受多少get/post/cookie輸入變量)
always_populate_raw_post_data = -1([color=rgba(0, 0, 0, 0.87)]開啟后就可以用 $HTTP_RAW_POST_DATA 接收post raw data)
date.timezone = Asia/Shanghai(時區)
七、啟動zabbix服務端和httpd服務
1、啟動zabbix-server服務
systemctl start zabbix-server
附:開機自啟動
chkconfig zabbix-server on
2、啟動httpd服務
systemctl start httpd.service
附:開機啟動
chkconfig httpd on
火狐等瀏覽器打開zabbix界面
http://192.168.1.5/zabbix
1、瀏覽器打開
http://192.168.1.5/zabbix
2、歡迎
3、檢查先決條件
4、配置數據庫
5、zabbix服務器詳細信息
6、安裝摘要
至此完成zabbix4.0(網頁篇)
1、安裝zabbix-agent(zabbix客戶端)
yum install zabbix-agent
2、啟動zabbix-agent
systemctl start zabbix-agent.servicechkconfig zabbix-agent on附:(1)查看zabbix-agent配置文件
grep -Ev '^$|^#' /etc/zabbix/zabbix_agentd.conf
(2)查看日志
cat /var/log/zabbix/zabbix_agentd.log
(3)查看zabbix-agent狀態
systemctl status zabbix-agent.service3、瀏覽器打開網頁
http://192.168.1.5/zabbix
至此完成zabbix二進制安裝(客戶端篇)
結束語:完成zabbix4.0二進制安裝(前端篇)
zabbix4.0二進制安裝(網頁篇)
zabbix4.0二進制安裝(客戶端篇)
至此,zabbix4.0二進制安裝配置才算完成。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。