您好,登錄后才能下訂單哦!
?? ?
??
Zabbix 是一個基于 WEB 界面的提供分布式系統(tǒng)監(jiān)視以及網(wǎng)絡(luò)監(jiān)視功能的企業(yè)級的開源解決方案。它能監(jiān)視各種網(wǎng)絡(luò)參數(shù),保證服務(wù)器系統(tǒng)的安全運營;并提供靈活的通知機制以讓系統(tǒng)管理員快速定位/解決存在的各種問題。
?
安裝環(huán)境:CentOS Linux release 7.5? IP:192.168.1.100
#?wget?https://mirrors.aliyun.com/zabbix/zabbix/4.4/rhel/7/x86_64/zabbix-release-4.4-1.el7.noarch.rpm
#?rpm?–ivh?zabbix-release-4.4-1.el7.noarch.rpm
?
安裝?Zabbix?server并使用?MySQL?數(shù)據(jù)庫:#?yum?-y?install?zabbix-server-mysql? 安裝?Zabbix?前端并使用?MySQL?數(shù)據(jù)庫:#?yum?-y?install?zabbix-web-mysql安裝Zabbix?agent客戶端,本機監(jiān)控:#?yum?-y?install?zabbix-agent
安裝zabbix-get工具
# yum –y install zabbix-get
安裝mariadb數(shù)據(jù)庫#?yum?-y?install?mariadb-server
?
#?systemctl?start?mariadb #?systemctl?enable?mariadb
創(chuàng)建Zabbix的數(shù)據(jù)庫名為zabbix,注意字符集的選擇MariaDB?[(none)]>?CREATE?DATABASE?zabbix?CHARSET?utf8?COLLATE?utf8_bin;創(chuàng)建Zabbix的用戶名為zabbixadmin,密碼為123456MariaDB?[(none)]>?GRANT?ALL?ON?zabbix.*?TO?zabbixadmin@localhost?IDENTIFIED?BY?'123456';
?
查看SQL語句的目錄#rpm?-ql?zabbix-server-mysql ... /usr/share/doc/zabbix-server-mysql-4.4.3/create.sql.gz ...導(dǎo)入SQL語句到剛才創(chuàng)建的zabbix數(shù)據(jù)庫中#zcat?/usr/share/doc/zabbix-server-mysql-4.4.3/create.sql.gz?|?mysql?-uzabbixadmin?-p123456?zabbix
?
#?vim?/etc/zabbix/zabbix_server.conf ... DBHost=localhost DBName=zabbix DBUser=zabbixadmin DBPassword=123456...
?
#?systemctl?start?zabbix-server #?systemctl?enable?zabbix-server
?
修改時區(qū)#?vim?/etc/httpd/conf.d/zabbix.conf php_value?date.timezone?Asia/Shanghai
?
#?systemctl?start?httpd #?systemctl?enable?httpd
?
安裝環(huán)境:CentOS release 6.9 (Final)? IP:192.168.1.200
?
注意:這里客戶端選擇的是CentOS6,需要安裝的是CentOS 6的yum源,如果要安裝其他版本的需要去阿里的mirrors里自行查找
#?wget?--no-check-certificate?https://mirrors.aliyun.com/zabbix/zabbix/4.4/rhel/6/x86_64/zabbix-release-4.4-1.el6.noarch.rpm
#?rpm?–ivh?zabbix-release-4.4-1.el6.noarch.rpm
?
#?yum?install?zabbix-agent
?
#?vim?/etc/zabbix/zabbix_agentd.conf ... Server=192.168.1.100????????????????????????????#?Zabbix?Server的ip地址ServerActive=192.168.1.100Hostname=web01 ...
?
#?service?zabbix-agent?start #?chkconfig?--add?zabbix-agent #?chkconfig?zabbix-agent?on
?
官方地址:https://www.zabbix.com/cn/download_agents
?
?
修改如下字段:
LogFile=c:\zabbix\zabbix_agentd.log
Server=192.168.1.100
ServerActive=192.168.1.100
Hostname=windows-web
?
C:Windows\system32>? cd c:\zabbix
c:\zabbix> bin\zabbix_agentd –i –c conf\zabbix_agentd.conf???? #安裝zabbix客戶端
c:\zabbix> bin\zabbix_agentd –s –c conf\zabbix_agentd.conf??? #啟動zabbix服務(wù)
?
http://192.168.1.100/zabbix
?
?
?
?
系統(tǒng)默認的用戶名:Admin
系統(tǒng)默認密碼:zabbix
?
?
?
原亂碼現(xiàn)象
服務(wù)器端安裝字體 #?yum?install?wqy-microhei-fonts?-y 修改字體鏈接,鏈接到新安裝的字體 #?rm?/usr/share/zabbix/assets/fonts/graphfont.ttf? #?ln?-sv?/usr/share/fonts/wqy-microhei/wqy-microhei.ttc?/usr/share/zabbix/assets/fonts/graphfont.ttf
?
修改后刷新頁面即可
?
?
?
除了Zabbix給的模板監(jiān)控項,我們可以自定義監(jiān)控的內(nèi)容
httpd開啟服務(wù)后會打開80端口
#?ss?-tnl State???????Recv-Q?Send-Q?????????????????????????????????????????????Local?Address:Port???????????????????????????????????????????????Peer?Address:Port? LISTEN??????0??????128???????????????????????????????????????????????????????????:::10050????????????????????????????????????????????????????????:::*?????LISTEN??????0??????128????????????????????????????????????????????????????????????*:10050?????????????????????????????????????????????????????????*:*?????LISTEN??????0??????128???????????????????????????????????????????????????????????:::80???????????????????????????????????????????????????????????:::*?????LISTEN??????0??????128???????????????????????????????????????????????????????????:::22???????????????????????????????????????????????????????????:::*?????LISTEN??????0??????128????????????????????????????????????????????????????????????*:22????????????????????????????????????????????????????????????*:*
可以通過命令取到值:ss -tnl | awk '{print $4}' | grep ':80$'
#?ss?-tnl?|?awk?'{print?$4}'?|?grep?–o?'80$'80
如過httpd服務(wù)關(guān)閉后,80端口也會關(guān)閉,此命令取不到值
?
自定義監(jiān)控項的目錄是/etc/zabbix/zabbix_agentd.d,在里面創(chuàng)建以.conf結(jié)尾的文件即可#?vim?/etc/zabbix/zabbix_agentd.d/port80.conf UserParameter=httpd.port80,??ss?-tnl?|?awk?'{print?$4}'?|?grep?–o?'80'
?
重啟服務(wù)
#?service?zabbix-agent?restarthttpd.port80?是給該監(jiān)控項取的名字 ss?-tnl?|?awk?'{print?$4}'?|?grep?–o?'80'?是自定義的監(jiān)控項取值命令
?
?
?
?
免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。