linux各版本zabbix-agent的安裝

 

https://www.zabbix.com/documentation/current/
官方的文檔ubuntu


ubuntu 安裝zabbix agent
#sudo apt-get install zabbix-agent
安裝完後會自動啓動: zabbix_server.conf (服務端配置文件)在/etc/zabbix目錄下 若是安裝了agent端,那zabbix_agentd.conf 也會在/etc/zabbix目錄下。 這個zabbix_agentd.conf 在Server和ServerActive兩處指定了zabbixserver的IP地址.vim

# vim /etc/zabbix/zabbix_agentd.conf
Server=10.0.0.49
修改完後重啓服務
/etc/init.d/zabbix-agent restartcentos

若是vi後提示Can't open file for writing,則代表權限不夠,則須要sudo vim /etc/zabbix/zabbix_agentd.conf來編輯該文件tcp

 


suse11sp三、suse12 安裝 zabbix-agentcentos7

一、添加repo源
suse11SP3
zypper addrepo http://download.opensuse.org/repositories/server:/monitoring/SLE_11_SP3/ server_monitoring
zypper update
suse12
zypper addrepo http://download.opensuse.org/repositories/server:/monitoring/SLE_12/ server_monitoring
zypper updatespa

二、安裝zabbix-agent
zypper install zabbix-agentrest

三、編輯/etc/zabbix/zabbix-agentd.conf文件
PidFile=/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=5 (設置zabbix日誌當到達5M時自動回滾,0表示disabled)
Server=zabbix (zabbix server端的ip或主機名)
ListenPort=10050
ServerActive=zabbix (zabbix server端的ip或主機名,在這裏能夠改變端口號)
Hostname=zabbix_agent
Timeout=30
AllowRoot=1 (設置是否容許以root用戶啓動,值有1和0,0表示禁止以root用戶啓動)
UnsafeUserParameters=1 (設置是否容許自定義監控,值有1和0,0表示disable)
EnableRemoteCommands=1 (設置是否容許來自zabbix server端的遠程命令,值有1和0,0表示不容許)
LogRemoteCommands=1 (設置是否容許日誌文件以warning級別記錄來自zabbix server端的遠程命令,值有1和0,0表示disabled)日誌

四、啓動zabbix-agentd服務並加入開機自啓動
suse11sp3:
service zabbix-agentd start
chkconfig zabbix-agentd onserver

suse12:
systemctl start zabbix-agentd
systemctl enable zabbix-agentdip

 

CentOS 安裝及配置 zabbxi-agent

1.安裝zabbix 軟件源
CentOS/RHEL 7:
rpm -Uvh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm

CentOS/RHEL 6:
rpm -Uvh http://repo.zabbix.com/zabbix/3.4/rhel/6/x86_64/zabbix-release-3.4-1.el6.noarch.rpm


2.安裝zabbix-agent
yum -y install zabbix-agent
yum install zabbix-sender zabbix-agent zabbix-get


3.在 /etc/zabbix/zabbix_agentd.conf 中更改:
Server=<zbx-server的ip>
ServerActive=<zbx-server的ip>
Hostname=<本機的名字>

4.重啓services,設置啓動和開機項
centos7設置開機啓動
systemctl start zabbix-agent.service
systemctl enable zabbix-agent.service

centos6設置開機啓動
service zabbix-agent restart
chkconfig --add zabbix-agent
chkconfig --list zabbix-agent

5.防火牆開通tcp 10050端口
centos的FW的防火牆位置/etc/sysconfig/iptables

-A INPUT -m state --state NEW -m tcp -p tcp --dport 10050 -j ACCEPT
注意要修改下防火牆文件的順序,開放的端口放在前面
重啓防火牆service iptables restart

ps:關閉防火牆的配置以下
systemctl stop firewalld
systemctl disable firewalld

5.1防火牆開通tcp 10050端口(centos7.X,使用firewall-cmd命令)firewall-cmd --zone=public --add-port=10050/tcp --permanent 添加端口firewall-cmd --reload 重啓防火牆服務firewall-cmd --query-port=10050/tcp,查詢某個端口是否開放

相關文章
相關標籤/搜索