Linux平台Zabbix Agent的安装配置
这里简单总结一下Linux平台Zabbix Agent的安装配置,实验测试的Zabbix版本比较老了(Zabbix 3.0.9),不过版本虽然有点老旧,但是新旧版本的安装步骤、流程基本差别不大。这里的总结仅仅当成一个操作手册,后续会更新或添加部分内容。
Linux版本众多,下面文档仅仅在RHEL、CentOS几个版本测试过。不同版本可能安装等有所差别,后续再补充完善。
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:检查被监控服务器的Linux发行版本
例如 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: 根据Zabbix Server的版本和Linux发行版本选择去下载对应的Zabbix Agent安装包
这个测试环境,我们就选择下载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%]
当然,如果服务器可以访问外网,也可以使用下面命令直接安装。
#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一般从客户端主动获取数据,当然客户端也可以主动将数据推送给服务端,客户端通过zabbix_sender指令来实现向服务端主动推送数据。这里不介绍zabbix_sender的安装、配置。后续打算单独介绍。
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
编辑参数文件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服务
启动Zabbix-Agent的几种方式,注意实际环境,有些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: 设置zabbix-agent服务开机自启动
# 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: 检查被监控的Linux服务器防火墙是否开通tcp 10050端口
这个非常简单,不做过多阐述。但是必须检查确认,否则Zabbix Server没法获取数据。
如果使用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 重启防火墙服务
firewall-cmd --query-port=10050/tcp,查询某个端口是否开放
版本问题:
注意事项:关于Zabbix Server和Zabbix Agent的版本是否要一致问题,这个尽量一致,版本一致,可以避免杂七杂八的问题出现。官方文档也有相关说明:Zabbix Server对Zabbix Agent是向下兼容的。但是要注意有些参数需要修改。请注意,高于3.0的Zabbix代理不能与Zabbix服务器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服务器3.0一起使用,但是不清楚是指大版本还是小版本,对于小版本。例如,我的测试环境Zabbix Server为3.0.9,客户端也可以安装zabbix-agent-3.0.28这个版本,测试暂未发现问题。
Linux平台Zabbix Agent的安装配置的更多相关文章
- zabbix--zabbix server的配置以及zabbix agent的安装配置
1.zabbix server端的配置在进行源码安装zabbix时已经配置好了,具体要配置的参数如下: ListenPort=10051 server服务的监听端口,默认是10051 DBHost= ...
- Linux平台 Oracle 12cR2 RAC安装Part2:GI配置
Linux平台 Oracle 12cR2 RAC安装Part2:GI配置 三.GI(Grid Infrastructure)安装 3.1 解压GI的安装包 3.2 安装配置Xmanager软件 3.3 ...
- Linux平台 Oracle 18c RAC安装Part2:GI配置
三.GI(Grid Infrastructure)安装 3.1 解压GI的安装包 3.2 安装配置Xmanager软件 3.3 共享存储LUN的赋权 3.4 使用Xmanager图形化界面配置GI 3 ...
- Linux平台 Oracle 18c RAC安装Part3:DB配置
四.DB(Database)配置 4.1 解压DB的安装包 4.2 DB软件配置 4.3 ASMCA创建磁盘组 4.4 DBCA建库 4.5 验证crsctl的状态 Linux平台 Oracle 18 ...
- Linux平台 Oracle 19c RAC安装Part2:GI配置
三.GI(Grid Infrastructure)安装 3.1 解压GI的安装包 3.2 安装配置Xmanager软件 3.3 共享存储LUN的赋权 3.4 使用Xmanager图形化界面配置GI 3 ...
- Linux平台 Oracle 19c RAC安装Part3:DB配置
Linux平台 Oracle 19c RAC安装Part3:DB配置 四.DB(Database)配置 4.1 解压DB的安装包 4.2 DB软件配置 4.3 ASMCA创建磁盘组 4.4 DBCA建 ...
- Linux平台 Oracle 11gR2 RAC安装Part1:准备工作
一.实施前期准备工作 1.1 服务器安装操作系统 1.2 Oracle安装介质 1.3 共享存储规划 1.4 网络规范分配 二.安装前期准备工作 2.1 各节点系统时间校对 2.2 各节点关闭防火墙和 ...
- Linux平台 Oracle 11gR2 RAC安装Part2:GI安装
三.GI(Grid Infrastructure)安装 3.1 解压GI的安装包 3.2 安装配置Xmanager软件 3.3 共享存储LUN的赋权 3.4 使用Xmanager图形化界面安装GI 3 ...
- Linux平台 Oracle 12cR2 RAC安装Part1:准备工作
Linux平台 Oracle 12cR2 RAC安装Part1:准备工作 一.实施前期准备工作 1.1 服务器安装操作系统 1.2 Oracle安装介质 1.3 共享存储规划 1.4 网络规范分配 二 ...
随机推荐
- 使用 .NET Core 3.x 构建 RESTFUL Api
准备工作:在此之前你需要了解关于.NET .Core的基础,前面几篇文章已经介绍:https://www.cnblogs.com/hcyesdo/p/12834345.html 首先需要明确一点的就是 ...
- 04 Ubuntu安装MySQL
1. 服务器端与客户端的安装 sudo apt-get install mysql-server mysql-client 2. 启动mysql服务 sudo service mysql start ...
- C# ASP response.write()弹出提示框后页面布局被打乱
发现在使用了response.write后样式发生了变化,位置和字体都不正确.Response.Write("<script>alert(')</script>&qu ...
- C#LeetCode刷题之#62-不同路径(Unique Paths)
目录 问题 示例 分析 问题 该文章的最新版本已迁移至个人博客[比特飞],单击链接 https://www.byteflying.com/archives/3680 访问. 一个机器人位于一个 m x ...
- C#LeetCode刷题-广度优先搜索
广度优先搜索篇 # 题名 刷题 通过率 难度 101 对称二叉树 42.1% 简单 102 二叉树的层次遍历 49.7% 中等 103 二叉树的锯齿形层次遍历 43.0% 中等 107 二 ...
- C#LeetCode刷题之#728-自除数(Self Dividing Numbers)
问题 该文章的最新版本已迁移至个人博客[比特飞],单击链接 https://www.byteflying.com/archives/3889 访问. 自除数 是指可以被它包含的每一位数除尽的数. 例如 ...
- speedtest测速网站测速节点添加流程
一.准备一台服务器: 系统需求:常见Linux系统: 二.服务器入网(确保可以访问互联网): 三.ssh登录到服务器安装speedtest守护程序程序包: 安装和启动,执行以下命令: curl -O ...
- Hexo博客中插入 Chart 动态图表
该文基本(全部)来自于chatjs中文文档 由于使用pjax,导致页面需要二次刷新才会显示表格,故引入了自动刷新的JS,但这样会导致回退标签失效 背景 今天在谷歌上逛博客时,突然发现shen-yu大佬 ...
- 获取网页js代码的一个方法
这个是看了别人的代码,稍加修改而成的.怕时间长忘了,在这里记一笔: console.log(require(["foo:bar.js"]).prototype.someMethod ...
- Socket、ServerSocket
1.服务器端程序 package demo12.net; import java.io.IOException; import java.io.InputStream; import java.io. ...