色综合图-色综合图片-色综合图片二区150p-色综合图区-玖玖国产精品视频-玖玖香蕉视频

您的位置:首頁技術(shù)文章
文章詳情頁

Linux平臺Zabbix Agent的安裝配置方法

瀏覽:221日期:2023-04-06 15:09:07

這里簡單總結(jié)一下Linux平臺Zabbix Agent的安裝配置,實驗測試的Zabbix版本比較老了(Zabbix 3.0.9),不過版本雖然有點老舊,但是新舊版本的安裝步驟、流程基本差別不大。這里的總結(jié)僅僅當(dāng)成一個操作手冊,后續(xù)會更新或添加部分內(nèi)容。

Linux版本眾多,下面文檔僅僅在RHEL、CentOS幾個版本測試過。不同版本可能安裝等有所差別,后續(xù)再補充完善。

1:首先檢查zabbix_server的版本

# zabbix_server --version
zabbix_server (Zabbix) 3.0.9
Revision 67444 19 April 2017, compilation time: Apr 23 2017 18:05:43
 
Copyright (C) 2017 Zabbix SIA
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it according to
the license. There is NO WARRANTY, to the extent permitted by law

2:檢查被監(jiān)控服務(wù)器的Linux發(fā)行版本

例如 RHEL或CentOS

# more /etc/redhat-release

Red Hat Enterprise Linux Server release 5.7 (Tikanga)

# more /etc/issue

Oracle Linux Server release 5.7

Kernel \r on an \m

3: 根據(jù)Zabbix Server的版本和Linux發(fā)行版本選擇去下載對應(yīng)的Zabbix Agent安裝包

這個測試環(huán)境,我們就選擇下載zabbix-agent-3.0.9-1.el5.x86_64.rpm這個RMP包,下載地址為http://repo.zabbix.com/zabbix/3.0/rhel/5/x86_64/

# rpm -ivh zabbix-agent-3.0.9-1.el5.x86_64.rpm
warning: zabbix-agent-3.0.9-1.el5.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 79ea5ed4
Preparing...    ########################################### [100%]
 1:zabbix-agent   ########################################### [100%]

當(dāng)然,如果服務(wù)器可以訪問外網(wǎng),也可以使用下面命令直接安裝。

#rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/5/x86_64/zabbix-agent-3.0.9-1.el5.x86_64.rpm

或者你配置了yum源,那就更簡單方便

#yum -y install zabbix-agent

我們知道,默認情況下Zabbix Server一般從客戶端主動獲取數(shù)據(jù),當(dāng)然客戶端也可以主動將數(shù)據(jù)推送給服務(wù)端,客戶端通過zabbix_sender指令來實現(xiàn)向服務(wù)端主動推送數(shù)據(jù)。這里不介紹zabbix_sender的安裝、配置。后續(xù)打算單獨介紹。

4:修改Zabbix-Agent的配置文件

首先找到zabbix_agentd.conf的位置,可以使用 rpm -ql zabbix-agent或 rpm -ql zabbix-agent | grep zabbix_agentd.conf

# rpm -ql zabbix-agent
/etc/init.d/zabbix-agent
/etc/logrotate.d/zabbix-agent
/etc/zabbix/zabbix_agentd.conf
/etc/zabbix/zabbix_agentd.d
/etc/zabbix/zabbix_agentd.d/userparameter_mysql.conf
/usr/sbin/zabbix_agentd
/usr/share/doc/zabbix-agent-3.0.9
/usr/share/doc/zabbix-agent-3.0.9/AUTHORS
/usr/share/doc/zabbix-agent-3.0.9/COPYING
/usr/share/doc/zabbix-agent-3.0.9/ChangeLog
/usr/share/doc/zabbix-agent-3.0.9/NEWS
/usr/share/doc/zabbix-agent-3.0.9/README
/usr/share/man/man8/zabbix_agentd.8.gz
/var/log/zabbix
/var/run/zabbix
# rpm -ql zabbix-agent | grep zabbix_agentd.conf
/etc/zabbix/zabbix_agentd.conf

編輯參數(shù)文件zabbix_agentd.conf

### Option: Server

# List of comma delimited IP addresses (or hostnames) of Zabbix servers.

# Incoming connections will be accepted only from the hosts listed here.

# If IPv6 support is enabled then "127.0.0.1", "::127.0.0.1", "::ffff:127.0.0.1" are treated equally.

#

# Mandatory: no

# Default:

# Server=

Server=127.0.0.1 #用Zabbix_Server的IP地址替換127.0.0.1

### Option: ServerActive

# List of comma delimited IP:port (or hostname:port) pairs of Zabbix servers for active checks.

# If port is not specified, default port is used.

# IPv6 addresses must be enclosed in square brackets if port for that host is specified.

# If port is not specified, square brackets for IPv6 addresses are optional.

# If this parameter is not specified, active checks are disabled.

# Example: ServerActive=127.0.0.1:20051,zabbix.domain,[::1]:30051,::1,[12fc::1]

#

# Mandatory: no

# Default:

# ServerActive=

ServerActive=127.0.0.1 #用Zabbix_Server的IP地址替換127.0.0.1

### Option: Hostname

# Unique, case sensitive hostname.

# Required for active checks and must match hostname as configured on the server.

# Value is acquired from HostnameItem if undefined.

#

# Mandatory: no

# Default:

# Hostname=

Hostname=Zabbix server #Zabbix客戶端主機名替換Zabbix server

5:啟動Zabbix-agent服務(wù)

啟動Zabbix-Agent的幾種方式,注意實際環(huán)境,有些Linux版本并不支持下面的一些方式。

方式1:

# service zabbix-agent start
Starting Zabbix agent: [ OK ]
# service zabbix-agent stop
Shutting down Zabbix agent: [ OK ]
# service zabbix-agent status
zabbix_agentd (pid 8120) is running...

方式2:

systemctl start zabbix-agent.service

systemctl stop zabbix-agent.service

方式3:

/etc/init.d/zabbix-agent start
 
/etc/init.d/zabbix-agent stop
 
/etc/init.d/zabbix-agent status

6: 設(shè)置zabbix-agent服務(wù)開機自啟動

# chkconfig --add zabbix-agent
# chkconfig --list | grep zabbix-agent
zabbix-agent 0:off 1:off 2:off 3:off 4:off 5:off 6:off

7: 檢查被監(jiān)控的Linux服務(wù)器防火墻是否開通tcp 10050端口

這個非常簡單,不做過多闡述。但是必須檢查確認,否則Zabbix Server沒法獲取數(shù)據(jù)。

如果使用iptables管理管理防火墻,例如(CentOS 5,6)

修改配置文件,防火墻的配置文件/etc/sysconfig/iptables,新增下面這樣的一條配置

-A RH-Firewall-1-INPUT -p tcp --dport 10050  -j ACCEPT

重啟防火墻service iptables restart

如果使用firewalld管理防火墻(例如,CentOS 7.x)

firewall-cmd --zone=public --add-port=10050/tcp --permanent 添加端口

firewall-cmd --reload 重啟防火墻服務(wù)

firewall-cmd --query-port=10050/tcp,查詢某個端口是否開放

版本問題:

注意事項:關(guān)于Zabbix Server和Zabbix Agent的版本是否要一致問題,這個盡量一致,版本一致,可以避免雜七雜八的問題出現(xiàn)。官方文檔也有相關(guān)說明:Zabbix Server對Zabbix Agent是向下兼容的。但是要注意有些參數(shù)需要修改。請注意,高于3.0的Zabbix代理不能與Zabbix服務(wù)器3.0一起使用。具體如下所示:

12 Version compatibility

Supported agents

Zabbix agents from previous Zabbix versions are compatible with Zabbix 3.0. However, you may need to review the configuration of older agents as some parameters have changed, for example, parameters related to logging for versions before 3.0.

To take full advantage of new and improved items, improved performance and reduced memory usage, use the latest 3.0 agent.

Note that Zabbix agent newer than 3.0 cannot be used with Zabbix server 3.0.

雖然官方文檔提示高于3.0的Zabbix代理不能與Zabbix服務(wù)器3.0一起使用,但是不清楚是指大版本還是小版本,對于小版本。例如,我的測試環(huán)境Zabbix Server為3.0.9,客戶端也可以安裝zabbix-agent-3.0.28這個版本,測試暫未發(fā)現(xiàn)問題。

總結(jié)

到此這篇關(guān)于Linux平臺Zabbix Agent的安裝配置方法的文章就介紹到這了,更多相關(guān)Zabbix Agent安裝配置內(nèi)容請搜索以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持!

標(biāo)簽: Zabbix
相關(guān)文章:
主站蜘蛛池模板: 中文在线免费视频 | 国产成人精品在视频 | 国内真实愉拍系列情侣自拍 | 欧美精品区 | 日韩国产欧美一区二区三区 | 猛操美女| jul-179在线中文字幕 | 久久综合久久美利坚合众国 | 国产成人久久精品二区三区 | 99久久免费精品视频 | 久久综合久久综合九色 | 欧美午夜精品久久久久免费视 | 久精品在线观看 | 秘书高跟黑色丝袜国产91在线 | 久青草国产手机在线观 | pgone太大了兽王免费视频 | 影院成人区精品一区二区婷婷丽春院影视 | 中文字幕一级 | 女人张开腿男人猛桶视频 | 国产高颜值露脸在线观看 | 天堂mv亚洲mv在线播放9蜜 | www.黄.com| 三级视频在线观看 | 国产高清第一页 | 91免费版网站 | 久久综合狠狠综合久久97色 | 宅男毛片| 日本一级毛片视频无遮挡免费 | 午夜专区 | 伊人色综合久久天天网蜜月 | 免费高清欧美一区二区视频 | 91欧美在线视频 | 久久久免费精品 | 亚洲一区二区三区福利在线 | www.色中色| 三级网址在线观看 | 亚洲第一页视频 | 久久草在线精品 | 草草视频在线播放 | 久草高清在线 | 看真人一级毛片 |