Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> 關於Linux

Zabbix Agent 客戶端安裝與配置步驟

監控伺服器就位後,每台被監控主機都需要裝上 agent。以下以 Zabbix 2.2.10 為例。

[root@localhost ~]# yum install -y gcc make
[root@localhost ~]# cd /usr/local/src
[root@localhost ~]# wget https://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.10/zabbix-2.2.10.tar.gz
[root@localhost src]# tar zxvf zabbix-2.2.10.tar.gz
[root@localhost zabbix-2.2.10]# ./configure --prefix=/usr/local/zabbix --enable-agent
[root@localhost zabbix-2.2.10]# make install

建立啟動腳本與便利連結

[root@localhost zabbix-2.2.10]# cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/
[root@localhost ~]# ln -s /usr/local/zabbix/etc /etc/zabbix
[root@localhost ~]# ln -s /usr/local/zabbix/sbin/zabbix_agentd /usr/local/sbin/

備份並編輯設定

[root@localhost ~]# cp /etc/zabbix/zabbix_agentd.conf /etc/zabbix/zabbix_agentd.conf-$(date +%Y%m%d)
[root@localhost ~]# vi /etc/zabbix/zabbix_agentd.conf
PidFile=/tmp/zabbix_agentd.pid
LogFile=/tmp/zabbix_agentd.log
EnableRemoteCommands=1
Server=192.168.55.132
ServerActive=192.168.55.132
Hostname=Zabbix server
UnsafeUserParameters=1

重點:Server 與 ServerActive 必須填 Zabbix Server 的 IP;Hostname 要與 Web 介面上新增主機時填的名稱一致,否則資料對不上。

啟動

[root@localhost ~]# /etc/init.d/zabbix_agentd start

記得放通伺服器端的 10050/tcp,並在 Web 介面新增主機;若 EnableRemoteCommands 與 UnsafeUserParameters 非必要,建議保持關閉以減少風險。

Zabbix Agent 客戶端安裝與配置步驟

Copyright © Linux教程網 All Rights Reserved