Jonnyan的原创笔记
alpine
alpine里python安装mssql笔记
Alpine linux如何配置和管理自定义服务
windows
window server2012远程授权重置
window获取本机所有IP
window远程桌面RDP加速方案
远程监控 Win10 资源占用
windows 下 mysql 区分大小写敏感问题
window下navicat无限试用脚本
win11恢复win10右键菜单样式
永久禁止windows更新
强制本地账户安装win10/11
Linux
解决openvpn的CRL has expired笔记
centos7.x配置时间服务器(chrony)
centos7.x下安装wireguard
解决influxdb的log日志输出位置
保存 iptable 规则并开机自动加载 | SA-Logs
kafka笔记
kafka的server.properties 配置文件参数说明
CentOS 和 RedHat 下 8 个最常用的 YUM 库
外网IP查询网站
VirtualBox Ubuntu20/centos7 命令行如何扩容分区磁盘
如何备份sqlite数据库
yum 安装 redis5/mq/consul
centos7.x 安装 docker-ce
zabbix4.2 的 yum+mariadb 方式部署安装
如何在 Linux 中查找最大的 10 个文件
mongodb 备份与还原操作
Linux 高频工具快速教程
yum 安装 influxdb/telegraf
ubuntu 14.04/16.04/18.04 yum 安装 zabbix-agent 教程
逃不掉的 mysql 数据库安装方式大全 yum rpm 源码
VIM 配置入门
find 命令结合 cp bash mv 命令使用的 4 种方式
Tomcat nginx log 日志按天分割切割
linux 和 pycharm 下终端彩色打印输出
centos5/6/7 下 yum 安装 zabbix-agent(被控端)
shell 脚本头,#!/bin/sh 与 #!/bin/bash 的区别.
electerm/tabby在执行screen命令后不显示滚动条
aws ec2 安装caddy2
No usable version of libssl was found
python
python virtualenv笔记
python配置文件INI/TOML/YAML/ENV的区别
python限制函数的执行时间
python里and和or的理解
SQLite is not a toy database | Anton Zhiyanov
四行代码实现 Python 管道 - Aber's blog
systemd管理虚拟环境Django+uwsgi+nginx配置教程
Linux shell命令创建python django用户
nginx子路径下反代运行多个django
django web 应用 runserver 模式下 cpu 占用高解决办法
解决 pip 安装模块报错 Cannot fetch index base URL http://pypi.python.org/simple/
docker
仅在首次启动时在Docker容器中运行命令
Docker多平台架构镜像构建
解决cadvisor监控内存值与docker stats命令值不一致问题
docker 清理指定日期之前的镜像
docker 部署 graylog 使用教程
docker 一键搭建 zerotier-moon 节点
alpine的docker镜像安装mysql/mariadb/redis
dockerfile 多阶段构建参考
Warning: Stopping docker.service, but it can still be activated by: docker.socket
nginx
Nginx限制并发连接数与下载速度
nginx仅允许域名访问禁止IP访问
Nginx 强制跳转 Https
nginx强制跳转https无限301循环问题
万字总结,带你全面系统的认识 Nginx
linux 下编译安装 nginx 完整版
解决 nginx 同端口强制跳转 https 配置 ssl 证书问题
nginx 关闭日志功能 access_log 关闭
基于 nginx 的 token 认证
杂记
小米手机MIUI12安装Google服务
使用sphinx+markdown+readthedocs+github来编写文档
N1由armbian直刷openwrt
N1安装docker版本的openwrt做旁路由
NUC10 i3/i5/i7系列开启局域网wol唤醒
威联通qnap安装nginx
威联通qnap配置开机自启动项
telegram bot python使用示例教程
四款paste临时文本分享平台
docker部署微力同步(verysync)
Android和IOS自部署通知程序
苹果M1如何科学上网
M1 mac iterm2配置lrzsz命令
漫威轮播
网件XR500/R7800刷机
DIY 编译 openwrt 固件
苹果 mac 版微软官方远程连接工具下载 Microsoft Remote Desktop For Mac
wireguard 实现 peer 互联, NAT to NAT
学习本来的样子
解决 aws ec2 的 centos7 设置时区无效
redis 问题优化
N1 如何完美刷入 armbian 系统教程
v2rayN 的 pac 简单规则
博客园 markdown 使用折叠语法和颜色标签
十年感悟之 python 之路
在浏览器输入 URL 回车后发生了什么?
grafana 里 prometheus 查询语法
国内开源镜像站点汇总
解决阿里云部署 office web apps ApplicationFailedException 报错问题
解决 mac 休眠睡眠异常耗电方法
jira 集成 fisheye 代码深度查看工具安装绿色版
阿里云 ecs 开启 x11 图形化桌面
markdown 完整语法规范 3.0 + 编辑工具介绍
pycharm 重置设置,恢复默认设置
[已解决]window 下 Can't connect to MySQL server on'localhost' (10061) 与无法启动 MYSQL 服务”1067 进程意外终止”
解决 xshell6 评估过期, 需采购问题
[已解决]pycharm 报错: AttributeError: module 'pip' has no attribute 'main'
[已解决]windows 下 python3.x 与 python2.7 共存版本 pip 使用报错问题
局域网共享工具总结
云策文档think配置https教程
MIUI12百度输入法小米版使用森林集皮肤办法
Jenkins 构建后通知到飞书
简易的openvpn安装
keychron V1键盘改键教程
caddy2配置SSE单向websock(How to proxy Server Sent Events caddy2)
机器监控告警
zabbix
yum / 编译安装 Zabbix 5.0 LTS
zabbix 监控 AWS-SQS 队列
Zabbix-agent 端配置文件说明
Prometheus+grafana
prometheus+grafana安装和配置
node_exporter主机监控
cadvisor容器监控
redis_exporter监控
rabbitmq_exporter监控
consul_exporter监控
windows_exporter
Open-Falcon
falcon 数据丢失处理方法参考
日志监控告警
graylog
graylog 通过 python 实现钉钉 / 微信 / webhook 告警
loki+grafana
Loki简介
Loki安装
Loki查询语法
grafana面板pannel语法
内网穿透
frp
zerotier
zerotier充当网关实现内网互联,访问其它节点内网
一分钟自建zerotier-plant
nps
anylink
N2N
OmniEdge
本文档发布于https://mrdoc.fun
-
+
首页
Zabbix-agent 端配置文件说明
> 本文由 [简悦 SimpRead](http://ksria.com/simpread/) 转码, 原文地址 [www.cnblogs.com](https://www.cnblogs.com/jonnyan/p/9045741.html) 由于工作中经常接触到 zabbix,所以将 agent 配置整理一下,方便日常查看。 ``` # This is a config file for the Zabbix agent daemon (Unix) # To get more information about Zabbix, visit [http://www.zabbix.com](http://www.zabbix.com/) ############ GENERAL PARAMETERS ################# ### Option: PidFile # Name of PID file. # # Mandatory: no # Default: **#pidFile=PID** **路径** **#****说明:指定程程序 PIDFILE 路径,可修改到其它路径,但 SNC 不建议修改** PidFile=/smp/sncmon/zabbix_agentd.pid ### Option: LogFile # Name of log file. # If not set, syslog is used. # # Mandatory: no # Default: # LogFile= **#LogFile=** **路径** **#****说明:客户端 AGENT 运行产生的日志文件路径,可修改到其它路径,如 / var/log/zabbix_agnetd.log,视具体情况修改,也可保持默认** LogFile=/smp/sncmon/zabbix_agentd.log ### Option: LogFileSize # Maximum size of log file in MB. # 0 - disable automatic log rotation. # # Mandatory: no # Range: 0-1024 # Default: **#LogFileSize=** **数字** **#****说明:AGENT 产生日志大小控制,默认 1M,若为 0,则表示不产生任何日志,数字范围(1-1024M)不建议关闭日志功能,建议保持默认** LogFileSize=1 ### Option: DebugLevel # Specifies debug level # **0 - no debug** **无日志级别** **# 1 - critical information** **灾难信息级别** **# 2 - error information** **一般错误信息级别** **# 3 - warnings** **警告级别** **# 4 - for debugging (produces lots of information)** **调试级别** **#****说明:0~4 级别,日志产生量在相同单位时间,生成的日志量为递增,即 0 级别日志量最少,4 级别最多,默认 3 级别,建议视具体情况,自行把握** # # Mandatory: no # Range: 0-4 # Default: DebugLevel=3 ### Option: SourceIP # Source IP address for outgoing connections. # # Mandatory: no # Default: **#SourceIP=IP** **地址** **#****说明:当系统设置有多个 IP 时,需要指定一个 IP 与二级代理或服务端通信,若系统只有一个 IP,也建议指定一个 IP** SourceIP=192.168.1.3 ### Option: EnableRemoteCommands # Whether remote commands from Zabbix server are allowed. # 0 - not allowed 不允许 # 1 - allowed 允许 # # Mandatory: no # Default: **#EnableRemoteCommands=0** **或 1** **#****说明:是否允许在本地执行远程命令,建议设置为 “允许”,因为 SNC 对命令下发功能进行了二次开发,功能强大,极大的方便日志运维工作** EnableRemoteCommands=1 ### Option: LogRemoteCommands **# Enable logging of executed shell commands as warnings.** **# 0 - disabled** **不产生日志** **# 1 - enabled** **产生日志** # # Mandatory: no # Default: **#LogRemoteCommands=1** **或 0** **#****说明: 在参数 EnableRemoteCommands=1 的情况下,执行远程命令是否保存操作日志,若已设置 EnableRemoteCommands=1** **#****建议 LogRemoteCommands=1,以便 日后查证。若 EnableRemoteCommands=0,此参数不生效** LogRemoteCommands=1 ##### Passive checks related **#****与被动模式有关的参数设置** **#****什么是被动模式?** **#****被动模式下,由二级代理或服务端主动请求 AGENT,去获取所采集到的监控数据** ### 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=IP** **地址或主机名,建议 IP 地址** **#****说明:在有二级代理情况下,此 IP 地址应该填写二级代理服务器的 IP,反之,若无二级代理服务器,则此 IP 应设置为服务端 #IP** Server=192.168.1.14 ### Option: ListenPort # Agent will listen on this port for connections from the server. # # Mandatory: no **# Range: 1024-32767** **(监控端口范围)** **# Default:** **# ListenPort=** **数字** **#****说明:此 AGENT 端以本地服务的形式运行,需要监听端口,强烈建议设置为 10050,以便移动整个系统统一规划管理,当然,特殊情况下可修改为 1024-32767 未使用的端口** ListenPort=10050 ### Option: ListenIP # List of comma delimited IP addresses that the agent should listen on. # First IP address is sent to Zabbix server if connecting to it to retrieve list of active checks. # # Mandatory: no # Default: **## ListenIP=IP** **地址** **#****说明:对应的 ListenPort 监听到哪个 IP 上面,建议指定 IP 时,不用 0.0.0.0** # ListenIP=192.168.1.6 ### Option: StartAgents # Number of pre-forked instances of zabbix_agentd that process passive checks. # If set to 0, disables passive checks and the agent will not listen on any TCP port. # # Mandatory: no **# Range: 0-100** **数字范围(0-100)** **# Default:** **#StartAgents=** **数字** **#****说明:在被动模式下,此参数用于设置控制监听进程可启用的子进程的数量,若监控项较多且采集很频繁,建议加大此数值** **;若此数值为 0,则禁止使用被动模式。另外,一般情况,不建议修改此数值,当且仅当某些监控项无法采集到数据,或数据采集数据有延迟现象时,可调整。第四,启用线程越多,则相对越耗系统资源** StartAgents=5 ##### Active checks related **#****主动模式相关参数设置** **#****什么时主动模式?** **#****在主动模式下,AGENT 端(即采集客户端)将所采集的结果,主动提交给二级代理服务器或服务器,而此种情况下,二级代理服务器或服务器将被动接收采集信息** ### 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=IP** **地址或 IP 地址:端口号** **#****说明:在主动模式下,ServerActive 为二级代理服务器或服务器,默认端口为 10051,若需更改端口,则为 #ServerActive=IP:port, 非特殊情况下,不建议修改。** ServerActive=192.168.1.14 ### 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=** **主机名** **#****说明:手工自定义一个主机名,可以和系统的主机名一样,也可以不一样,此参数可根据实际情况启用或关闭,建议关闭此参数,并启用 HostnameItem 参数** #Hostname=Zabbix server ### Option: HostnameItem # Item used for generating Hostname if it is undefined. # Ignored if Hostname is defined. # # Mandatory: no # Default: **#HostnameItem****:自动获取主机名** **#****说明:system.hostname 是 ZABBIX 内置的一个自动获取主机名的方法,为了方便配置,建议打开此参数而关闭 Hostname 参数 #。注意:HostnameItem 的优化级低于 Hostname,当两个参数都启用且配置的情况下,ZABBIX 获取的主机名,将以 Hostname 为 #准** HostnameItem=system.hostname ### Option: HostMetadata # Optional parameter that defines host metadata. # Host metadata is used at host auto-registration process. # An agent will issue an error and not start if the value is over limit of 255 characters. # If not defined, value will be acquired from HostMetadataItem. # # Mandatory: no **# Range: 0-255 characters 0-255** **个字符** **# Default:** **# HostMetadata=** **字符串** **#****说明:用于定义当前主机唯一标识符,最大长度 255 个,仅适用于自动发现情况下,默认不定义,建议不定义** # HostMetadata= ### Option: HostMetadataItem # Optional parameter that defines an item used for getting host metadata. # Host metadata is used at host auto-registration process. # During an auto-registration request an agent will log a warning message if # the value returned by specified item is over limit of 255 characters. # This option is only used when HostMetadata is not defined. # # Mandatory: no # Default: **#****说明;用于获取主机的 HostMetadata,建议保持默认** # HostMetadataItem= ### Option: RefreshActiveChecks # How often list of active checks is refreshed, in seconds. # # Mandatory: no # Range: 60-3600 # Default: **#RefreshActiveChecks=** **数字** **#****说明:被监控的主机多久(秒)重新请求二级代理或服务端刷新一监控列表。范围为 60-3600 秒。ZABBIX 运行原理为:,zabbix 客户端启动后,在等待 RefreshActiveChecks 秒后,开始从二级代理或服务端请求并下载监控项信息,保存在本地专门的 buffersend 中,再过 RefreshActiveChecks 秒后,重新获取监控项信息。这就是为什么当配置监控项,要过一会才能生效的原因。这个数值,就是等待时间。建议,不要将此数值设置过小,以免加大 AGENT 端和服务端及数据库的压力,建议为 120 秒。** RefreshActiveChecks=120 ### Option: BufferSend # Do not keep data longer than N seconds in buffer. # # Mandatory: no # Range: 1-3600 # Default: **#BufferSend=** **数字** **#****说明:多少秒后,将 BUFFER 中的数据提交到二级代理或服务端。范围(1-36600)此数值的大小决定了采集后,提交数据的及时性,数值越小,则提交得越频繁,对服务器压力越大,同时对 AGENT 端系统资源消耗越大,则表现出来的现象是报警非常及时,建议根据实际情况自行考虑,也可保持默认,若发现 ZABBIX 消耗资源较多,建议加大此数值。** BufferSend=5 ### Option: BufferSize # Maximum number of values in a memory buffer. The agent will send # all collected data to Zabbix Server or Proxy if the buffer is full. # # Mandatory: no # Range: 2-65535 # Default: **#BufferSize=** **数值** **#****说明:此参数作用设置保存采集数据在内存中的容量大小。若此 agent 端监控项较多,建议加大此数值。BufferSize 与 BufferSend 之间有联系的。当达到 bUFFERSEND 或 Buffersize 已满时,都会触发数据提交动作。** BufferSize=100 ### Option: MaxLinesPerSecond # Maximum number of new lines the agent will send per second to Zabbix Server # or Proxy processing 'log' and 'logrt' active checks. # The provided value will be overridden by the parameter 'maxlines', # provided in 'log' or 'logrt' item keys. # # Mandatory: no # Range: 1-1000 # Default: **#MaxLinesPerSecond=** **数值** **#****说明:定义了 AGENT 在 1 秒内发送的日志行数,用于避免网络或 cpu 过载,建议保持默认** # MaxLinesPerSecond=100 ############ ADVANCED PARAMETERS ################# **#****高级参数设置** ### Option: Alias # Sets an alias for parameter. It can be useful to substitute long and complex parameter name with a smaller and simpler one. # # Mandatory: no # Range: # Default: **#****设置参数的别名。它可以替代长和复杂的一个小而简单的一个有用的参数名称** #alias_name=long_command ### Option: Timeout # Spend no more than Timeout seconds on processing # # Mandatory: no # Range: 1-30 # Default: **#Timeout=** **数值** **#****说明:当 agent 采集一个数据时,多长少算超时。建议保持默认** Timeout=30 ### Option: AllowRoot # Allow the agent to run as 'root'. If disabled and the agent is started by 'root', the agent # will try to switch to user 'zabbix' instead. Has no effect if started under a regular user. # 0 - do not allow # 1 - allow # # Mandatory: no # Default: **#AllowRoot=0** **或 1** **#****说明:是否允许 ROOT 帐号运行此客户端。0:不允许,1: 允许,当一个脚本执行需要以 ROOT 身份执行的,则此开关必须打开,建议根据实际情况开启或关闭,** AllowRoot=0 ### Option: Include # You may include individual files or all files in a directory in the configuration file. # Installing Zabbix will create include directory in /usr/local/etc, unless modified during the compile time. # # Mandatory: no # Default: # Include= **# Include=** **目录路径或扩展配置文件路径** **#****说明:从配置文件可管理性或扩展性考虑,若需配置大量参数的且为了方便后续管理可以启用此参数,建议根据实际情况考虑,不过,一般情况下无须启用** # Include=/usr/local/etc/zabbix_agentd.userparams.conf # Include=/usr/local/etc/zabbix_agentd.conf.d/ ####### USER-DEFINED MONITORED PARAMETERS ####### **#****自定义监控脚本** ### Option: UnsafeUserParameters # Allow all characters to be passed in arguments to user-defined parameters. # 0 - do not allow # 1 - allow # # Mandatory: no # Range: 0-1 # Default: **#UnsafeUserParameters=0** **或 1** **#****说明:是否启用用户自定义监控脚本,1 启用,0 不启用。由于 ZABBIX 实现监控方法的多样性,一般都采用脚本来实现监控数据的采集,所以,建议开启,否则功能将受限。** UnsafeUserParameters=1 ### Option: UserParameter # User-defined parameter to monitor. There can be several user-defined parameters. # Format: UserParameter=, # See 'zabbix_agentd' directory for examples. # # Mandatory: no # Default: # UserParameter= ####### LOADABLE MODULES ####### ### Option: LoadModulePath # Full path to location of agent modules. # Default depends on compilation options. # # Mandatory: no # Default: # LoadModulePath=${libdir}/modules **#****说明:扩展模块路径,强烈建议不要改动,除非你具有 AGENT 开发能力** # LoadModulePath=${libdir}/modules ### Option: LoadModule # Module to load at agent startup. Modules are used to extend functionality of the agent. # Format: LoadModule= # The modules must be located in directory specified by LoadModulePath. # It is allowed to include multiple LoadModule parameters. # # Mandatory: no # Default: **#****说明:扩展模块路径,强烈建议不要改动,除非你具有 AGENT 开发能力** # LoadModule= #UserParameter= **#****说明:用户自定义监控脚本,当且仅当 UnsafeUserParameters=1 时 UserParameter 生效。以下为 SNC 初始自定监控脚本,不建议修改,已有选项,但可自义添加。** **#****自定义监控项配置语法** **#UserParameter=key,command** **#****如何使用:以获取 mysql 监控为例** **#****步骤 1,设置自定义脚本** **#UserParameter=mysql.questions,mysqladmin -uroot --password='XXXXX' status|cut -f4 -d":"|cut -f1 -d"S"** **#****保存退出,并重启 AGENT** **#****步骤 2,手工验证** **#****在二级代理端或服务器端用命令 zabbix_get -s IP -k mysql.questions 将返回采集信息** **#****步骤 3,在管理页面添加监控项** **#****注意: 成功关键,脚本本身具有可执行权限,且脚本运行正常** UserParameter=cmd[*],$1 $2 $3 $4 $5 $6 $7 $8 $9 UserParameter=setenv[*],java -jar /smp/sncmon/java/setenv/setenv.jar $1 $2 UserParameter=oracle[*],java -jar /smp/sncmon/java/oracle/oracle.jar $1 /smp/sncmon/java/oracle/ UserParameter=db2[*],/smp/sncmon/java/db2/linux.sh $1 UserParameter=mindwaresctipt,setsid /smp/sncmon/shell/middleware/middle_zabbix.sh UserParameter=agent.restart,/smp/sncmon/shell/agent/agentrestart.sh UserParameter=diskmon,/smp/sncmon/shell/diskmon/disk_mon.sh $1 ```
Jonny
Feb. 22, 2022, 10:51 p.m.
544
0 条评论
转发文档
收藏文档
上一篇
下一篇
手机扫码
复制链接
手机扫一扫转发分享
复制链接
【腾讯云】爆款2核2G4M云服务器一年45元,企业首购最高获赠300元京东卡
【腾讯云】爆款2核2G4M云服务器一年45元,企业首购最高获赠300元京东卡
Markdown文件
PDF文档
PDF文档(打印)
分享
链接
类型
密码
更新密码