Centos7.3安裝部署最新版Zabbix3.4的方法(圖文)
一、系統(tǒng)環(huán)境
cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
關(guān)閉防火墻及selinux
systemctl stop firewalld.service systemctl disable firewalld.service sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config grep SELINUX=disabled /etc/selinux/config setenforce 0
二、數(shù)據(jù)庫(kù)安裝及配置
1、MariaDB概述
MariaDB數(shù)據(jù)庫(kù)管理系統(tǒng)是MySQL的一個(gè)分支,主要由開源社區(qū)在維護(hù),采用GPL授權(quán)許可。
開發(fā)這個(gè)分支的原因是:甲骨文公司收購(gòu)了MySQL后,有將MySQL閉源的潛在風(fēng)險(xiǎn),因此社區(qū)采用分支的方式來(lái)避開這個(gè)風(fēng)險(xiǎn)。
MariaDB的目的是完全兼容MySQL,包括API和命令行,使之能輕松成為MySQL的代替品。
2、安裝mariadb
yum install mariadb-server mariadb -y
mariadb數(shù)據(jù)庫(kù)的相關(guān)命令是:
systemctl start mariadb #啟動(dòng)MariaDB systemctl stop mariadb #停止MariaDB systemctl restart mariadb #重啟MariaDB systemctl enable mariadb #設(shè)置開機(jī)啟動(dòng)
三、Zabbix3.4安裝及配置
1、Zabbix3.4新功能概述
- Remote command support through proxies
- Parallel processing of alerts
- Being notified on problem acknowledgement
- Item value preprocessing
- Configurable JMX endpoints
- JMX low-level discovery
- PCRE library for regular expressions
- URL-encoding support in web monitoring
- Support of macros and time suffixes in time periods
- Host macro support in event tags
- Frontend improvements
- Daemon improvements
- Item changes/improvements
- Low-level discovery
- Return code check for scripts and commands
zabbixe中文文檔 https://www.zabbix.com/documentation/3.4/zh/manual
2、Zabbix3.4安裝
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm yum install zabbix-server-mysql zabbix-web-mysql -y
3、創(chuàng)建數(shù)據(jù)庫(kù)
create database zabbix character set utf8 collate utf8_bin; grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
4、導(dǎo)入數(shù)據(jù)
zcat /usr/share/doc/zabbix-server-mysql-3.4.0/create.sql.gz | mysql -uzabbix -pzabbix zabbix
5、配置數(shù)據(jù)庫(kù)用戶及密碼
grep -n '^'[a-Z] /etc/zabbix/zabbix_server.conf 38:LogFile=/var/log/zabbix/zabbix_server.log 49:LogFileSize=0 72:PidFile=/var/run/zabbix/zabbix_server.pid 99:DBName=zabbix 115:DBUser=zabbix 123:DBPassword=zabbix 314:SNMPTrapperFile=/var/log/snmptrap/snmptrap.log 432:Timeout=4 474:AlertScriptsPath=/usr/lib/zabbix/alertscripts 484:ExternalScripts=/usr/lib/zabbix/externalscripts 520:LogSlowQueries=3000
6、啟動(dòng)zabbix server并設(shè)置開機(jī)啟動(dòng)
systemctl enable zabbix-server systemctl start zabbix-server
7、編輯Zabbix前端PHP配置,更改時(shí)區(qū)
vim /etc/httpd/conf.d/zabbix.conf php_value date.timezone Asia/Shanghai
8、SELinux配置
setsebool -P httpd_can_connect_zabbix on setsebool -P httpd_can_network_connect_db on
9、啟動(dòng)httpd并設(shè)置開機(jī)啟動(dòng)
systemctl start httpd systemctl enable httpd
四、安裝Zabbix Web
1、瀏覽器訪問(wèn),并進(jìn)行安裝http://172.16.8.254/zabbix/
2、點(diǎn)擊next會(huì)出現(xiàn)檢查狀態(tài)
3、檢查系統(tǒng)環(huán)境設(shè)置,必須全部都為ok,才能繼續(xù)
4、輸入連接到數(shù)據(jù)庫(kù)詳細(xì)信息。Zabbix數(shù)據(jù)庫(kù)必須已經(jīng)創(chuàng)建好
5、連接Zabbix服務(wù)細(xì)節(jié),如果沒(méi)有改變可選擇默認(rèn)
7、完成安裝,會(huì)將在/etc/zabbix/web/zabbix.conf.php生成配置文件
Congratulations! You have successfully installed Zabbix frontend. Configuration file "/etc/zabbix/web/zabbix.conf.php" created.
8、登錄最新版Zabbix3.4 默認(rèn)用戶Admin 默認(rèn)密碼zabbix
五、zabbxi-agent安裝及配置
1、安裝zabbxi-agent
yum install zabbix-agent -y
2、配置zabbxi-agent
grep -n '^'[a-Z] /etc/zabbix/zabbix_agentd.conf 13:PidFile=/var/run/zabbix/zabbix_agentd.pid 32:LogFile=/var/log/zabbix/zabbix_agentd.log 43:LogFileSize=0 97:Server=172.16.8.254 138:ServerActive=172.16.8.254 149:Hostname=Zabbix server 267:Include=/etc/zabbix/zabbix_agentd.d/*.conf
3、啟動(dòng)zabbxi-agent并設(shè)置開機(jī)啟動(dòng)
systemctl enable zabbix-agent.service systemctl restart zabbix-agent.service
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
Linux虛擬機(jī)復(fù)制文件到Windows主機(jī)的解決辦法
這篇文章主要介紹了Linux虛擬機(jī)復(fù)制文件到Windows主機(jī)的解決辦法,文中通過(guò)代碼示例和圖文講解的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作有一定的幫助,需要的朋友可以參考下2024-07-07Linux使用其他用戶(非root用戶)設(shè)置root權(quán)限及免密(Centos7為例)
這篇文章主要介紹了Linux使用其他用戶(非root用戶)設(shè)置root權(quán)限及免密(Centos7為例),具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2024-05-05linux里daily_routine實(shí)例代碼詳解
在本篇文章里小編給大家整理的是關(guān)于linux里daily_routine實(shí)例代碼以及相關(guān)知識(shí)點(diǎn)內(nèi)容,有需要的朋友們參考下。2019-09-09CentOS使用expect批量遠(yuǎn)程執(zhí)行腳本和命令
這篇文章主要介紹了CentOS使用expect批量遠(yuǎn)程執(zhí)行腳本和命令,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下2020-06-06linux防火墻配置(基于yum倉(cāng)的配置)詳細(xì)步驟
大家好,本篇文章主要講的是linux防火墻配置(基于yum倉(cāng)的配置)詳細(xì)步驟,感興趣的同學(xué)快來(lái)看一看吧,對(duì)你有幫助的話記得收藏一下,方便下次瀏覽2021-11-11關(guān)于linux下core dump【總結(jié)】
下面小編就為大家?guī)?lái)一篇關(guān)于linux下core dump【總結(jié)】。小編覺(jué)得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2017-01-01