熱門搜索 Zabbix技術資料 Zabbix常見問、答討論 成功案例 Zabbix交流區 Prometheus交流區
zabbix agent安裝前提說明
需要安裝curl命令,安裝腳本的主機需要和nginx主機互通。
安裝Nginx可以使用編譯安裝或者yum安裝,區別是yum安裝后,使用systemctl enable nginx 會自動生成nginx.service服務文件,編譯安裝需要手動新增nginx.service服務文件,才能使用systemctl命令管理nginx。編譯安裝參考:
http://m.ydcanyin.com/forum.php?mod=viewthread&tid=208&highlight=nginx
nginx.service服務配置參考,注意文件路徑
vim /lib/systemd/system/nginx.service
[Unit]
Description=nginx
After=network.target
[Service]
Type=forking
ExecStart=/itops/nginx/sbin/nginx -c /itops/nginx/conf/nginx.conf
ExecReload=/itops/nginx/sbin/nginx -s reload
ExecStop=/itops/nginx/sbin/nginx -s quit
PrivateTmp=true
[Install]
WantedBy=multi-user.target
然后給腳本執行權限,chmod 755
/lib/systemd/system/nginx.service
自啟 systemctl enable nginx.service 或 chkconfig nginx on
在配置文件nginx.conf配置以下文件存放路徑,圖下意思是在/目錄新增一個agent文件夾,之后需要把文件放到這個文件下
保存后,需要重啟nginx才能生效,在重啟前,可以使用以下命令測試一下配置文件是否正常,如有報錯,會提示在第幾行的配置有誤!
/itops/nginx/sbin/nginx -t
nginx: the configuration file /itops/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /itops/nginx/conf/nginx.conf test is successful
第三步:測試安裝
把需要執行的文件放到第二步配置/agent目錄
文件可以是執行腳本,也可以是壓縮包或者是rpm包,這里舉例為安裝zabbix_agentd免編譯版,利用制作的zabbix_agent安裝相關文件及配置安裝。
如果不是直接的腳本文件,確保壓縮包里面有安裝執行的shell文件
然后到任意的linux主機使用以下命令執行安裝:
curl -O http://nginx主機ip/agent/linux_agent.tar && tar -xf linux_agent.tar && cd linux_agent && sh install_agent.sh install
更多zabbix技術文章,請關注尊龍時凱社區:http://forum.ydcanyin.com/
尊龍時凱監控結合該銀行發展在的現狀及發展需求,幫助其構建一個安全、實用、可持續發展的智能監控管理平臺。
View details