標籤:strong 圖片 方法 start 解決方案 esc serve chmod core
上一篇簡單的介紹了怎麼搭建Zabbix監控服務端,接下來給大家介紹怎麼在windows和Centos7上安裝zabbix_agent用戶端。
Zabbix是一個基於WEB介面的提供分布式系統監視以及網路監視功能的企業級的開源解決方案。
Zabbix由2部分構成,zabbix server(監控端)與可選組件zabbix agent(被監控端)一、系統內容
linux系統windows系統zabbix_agent安裝包(我安裝的3.0.9版本,所以使用的用戶端也是3.0.9版本)
二、關閉Selinux
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
更改selinux需要重啟系統(reboot或init 6重啟)才會生效!
三、暫時關閉防火牆
systemctl stop firewalld #關閉防火牆
四、安裝zabbix用戶端
1、編譯安裝
安裝依賴包yum -y install net-snmp-devel gcc-c++ openssl openssl-devel curl-devel建立使用者groupadd zabbixuseradd -g zabbix -m zabbix編譯安裝cd /opttar -zxvf zabbix-3.0.9.tar.gzcd zabbix-3.0.9./configure --prefix=/opt/zabbix --sysconfdir=/opt/zabbix/etc --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-opensslmake install
2、修改設定檔
cd /opt/zabbix/etc/cp zabbix_agentd.conf zabbix_agentd.conf.baksed -i ‘s/Server=127.0.0.1/Server=172.16.*.*/g‘ /opt/zabbix/etc/zabbix_agentd.conf ##更改第二個Server地址為zabbix服務端IP地址sed -i ‘s/ServerActive=127.0.0.1/ServerActive=172.16.*.*/g‘ /opt/zabbix/etc/zabbix_agentd.confecho "zabbix-agent 10050/tcp #Zabbix Agent" >> /etc/services echo "zabbix-agent 10050/udp #Zabbix Agent" >> /etc/services修改開機檔案cp /opt/zabbix-3.0.9/misc/init.d/fedora/core/zabbix_agentd /etc/init.d/chmod +x /etc/init.d/zabbix_agentdln -s /opt/zabbix/sbin/* /usr/local/sbin/ln -s /opt/zabbix/bin/* /usr/local/bin/
3、設定自啟動
cp /opt/zabbix-3.0.9/misc/init.d/fedora/core/zabbix_agentd /etc/rc.d/init.d/sed -i ‘s/# chkconfig: - 90 10/# chkconfig: 2345 10 90/g‘ /etc/rc.d/init.d/zabbix_agentdsed -i ‘4,6d‘ /etc/rc.d/init.d/zabbix_agentdecho "# description: zabbix agent" >> /etc/rc.d/init.d/zabbix_agentdcdchkconfig --add zabbix_agentdchkconfig zabbix_agentd onsystemctl start zabbix_agentd
4、檢查進程是否啟動正常
ps -ef | grep zabbix_agentd
五、Windows安裝Zabbix用戶端
1、下載zabbix軟體包
2、解壓檔案會出現兩個目錄
bin目錄(運行檔案)和conf目錄(設定檔)
3、修改設定檔
Server=172.16.*.* #後面地址為Zabbix伺服器端的IP地址ServerActive=172.16.*.* #後面地址為Zabbix伺服器端的IP地址
4、根據你當前windows的版本選擇64位還是32位的進行安裝
我的是伺服器是64位系統
c:\zabbix\bin\win64\zabbix_agentd.exe -c c:\zabbix\conf\zabbix_agentd.win.conf -i #載入設定檔c:\zabbix\bin\win64\zabbix_agentd.exe -c c:\zabbix\conf\zabbix_agentd.win.conf -s #添加windows自啟動服務
win+r-->輸入services.msc-->開啟"Zabbix Agent"
改為自動啟動,並重啟服務即可!開啟防火牆則需要允許存取10050連接埠。
5、刪除服務(有需要再刪除,刪除的同時先停止服務)
win+r-->輸入cmd-->sc delete "Zabbix Agent"(必須是管理員權限)
6、檢查連接埠
win+r-->輸入cmd-->netstat -an-->尋找10050連接埠預設
服務端添加主機的方法跟linux系統一樣,就不在此多寫了。
今天就介紹到此!後續請關注更新!
Zabbix安裝用戶端agent(windows和Centos7)