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 网络规范分配 二 ...
随机推荐
- Nginx - location常见配置指令,alias、root、proxy_pass
1.[alias]——别名配置,用于访问文件系统,在匹配到location配置的URL路径后,指向[alias]配置的路径.如: location /test/ { alias/first/secon ...
- ACL权限管理 学习
#查看权限 getfacl 文件名 例子:getfacl test 结果:# file: test# owner: root# group: rootuser::rw-group::r-xother: ...
- java从零到变身爬虫大神
刚开始先从最简单的爬虫逻辑入手 爬虫最简单的解析面真的是这样 import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import java. ...
- C#LeetCode刷题之#48-旋转图像(Rotate Image)
问题 该文章的最新版本已迁移至个人博客[比特飞],单击链接 https://www.byteflying.com/archives/3668 访问. 给定一个 n × n 的二维矩阵表示一个图像. 将 ...
- C#LeetCode刷题之#561-数组拆分 I(Array Partition I)
问题 该文章的最新版本已迁移至个人博客[比特飞],单击链接 https://www.byteflying.com/archives/3718 访问. 给定长度为 2n 的数组, 你的任务是将这些数分成 ...
- MongoDB学习1:认识文档数据库MongoDB
1. 关于MongoDB 什么是MongoDB 一个以JSON为数据模型的文档数据库 为什么叫文档数据库 文档来自于"JSON Document",并非我们一般理解的pdf,wor ...
- Shiro+SpringBoot认证
该博客以Web为基础 一.引入依赖 shiro-all包含shiro所有的包.shiro-core是核心包.shiro-web是与web整合.shiro-spring是与spring整合.shiro- ...
- CSS动画实例:跳跃的字符
1.翻转的字符 在页面中放置一个类名为container的层作为容器,在该层中放置5个字符区域,HTML代码描述如下: <div class="container"> ...
- 用过 mongodb 吧, 这三个大坑踩过吗?
一:背景 1. 讲故事 前段时间有位朋友在微信群问,在向 mongodb 中插入的时间为啥取出来的时候少了 8 个小时,8 在时间处理上是一个非常敏感的数字,又吉利又是一个普适的话题,后来我想想初次使 ...
- mysql查看死锁及解锁方法
解除正在死锁的状态有两种方法: 第一种: 1.查询是否锁表 show OPEN TABLES where In_use > 0; 2.查询进程(如果您有SUPER权限,您可以看到所有线程.否则, ...