标签:zabbix配置文件详解
zabbix配置文件详解 一、配置文件类型 zabbix_server配置文件:zabbix_server.conf zabbix_proxy配置文件:zabbix_proxy.conf zabbix-agentd配置文件:zabbix_agentd.conf 二、配置文件详解 zabbix_server.conf # This is a configuration file for Zabbix Server process # To get more information about Zabbix, # visit http://www.zabbix.com ############ GENERAL PARAMETERS ################# ### Option: NodeID # Unique NodeID in distributed setup. # 0 - standalone server # # Mandatory: no # Range: 0-999 # Default: # NodeID=0 //分布式节点id号,0代表是独立服务器,默认是被注释掉的 ### Option: ListenPort # Listen port for trapper. # # Mandatory: no # Range: 1024-32767 # Default: ListenPort=10051 //zabbix server的端口,默认是10051 ### Option: SourceIP # Source IP address for outgoing connections. # # Mandatory: no # Default: # SourceIP= SourceIP=0.0.0.0 //连接的源ip地址,默认为空,默认即可 ### Option: LogFile # Name of log file. # If not set, syslog is used. # # Mandatory: no # Default: # LogFile= LogFile=/tmp/zabbix_server.log //日志文件的存放位置 ### Option: LogFileSize # Maximum size of log file in MB. # 0 - disable automatic log rotation. # # Mandatory: no # Range: 0-1024 # Default: LogFileSize=1024 //日志文件的大小,单位为MB,当设置为0时,表示不进行日志轮询 ### Option: DebugLevel # Specifies debug level # 0 - no debug //无日志 # 1 - critical information //灾难日志,日志量较少 # 2 - error information //错误级别,日志量大于CRITICAL级别 # 3 - warnings //告警级别,日志量大于ERROR级别 # 4 - for debugging (produces lots of information) //调试级别,日志量大于WARNING # # Mandatory: no # Range: 0-4 # Default: # DebugLevel=3 DebugLevel=3 //指定调试级别,默认即可 ### Option: PidFile # Name of PID file. # # Mandatory: no # Default: PidFile=/tmp/zabbix_server.pid //pid文件的存放位置 ### Option: DBHost # Database host name. # If set to localhost, socket is used for MySQL. # If set to empty string, socket is used for PostgreSQL. # # Mandatory: no # Default: DBHost=10.10.8.167 //数据库主机名 ### Option: DBName # Database name. # For SQLite3 path to database file must be provided. DBUser and DBPassword are ignored. # # Mandatory: yes # Default: # DBName= DBName=zabbix //指定存放zabbix数据数据库的名字 ### Option: DBSchema # Schema name. Used for IBM DB2. # # Mandatory: no # Default: # DBSchema= //专门用于 IBM DB2数据库的连接信息 ### Option: DBUser # Database user. Ignored for SQLite. # # Mandatory: no # Default: # DBUser= DBUser=zabbix //指定连接数据库的用户名 ### Option: DBPassword # Database password. Ignored for SQLite. # Comment this line if no password is used. # # Mandatory: no # Default: DBPassword=zabbix ### Option: DBSocket # Path to MySQL socket. # # Mandatory: no # Default: #DBSocket=/var/lib/mysql/mysql.sock //前文DBHost设置为localhost,用户连接数据库所用的sock位置 ### Option: DBPort # Database port when not using local socket. Ignored for SQLite. # # Mandatory: no # Range: 1024-65535 # Default (for MySQL): DBPort=3306 //数据库的端口号,当用sock连接时,无关紧要,当通过网络连接时需设置 ############ ADVANCED PARAMETERS ################ #高级参数 ### Option: StartPollers # Number of pre-forked instances of pollers. # # Mandatory: no # Range: 0-1000 # Default: StartPollers=180 //初始化时,启动子进程数量,数量越多,则服务端吞吐能力越强,对系统资源消耗越大 ### Option: StartIPMIPollers # Number of pre-forked instances of IPMI pollers. # # Mandatory: no # Range: 0-1000 # Default: # StartIPMIPollers=0 //主要用于IPMI技术用于获取硬件状态场景。若无相关监控项,建议设置为0 ### Option: StartPollersUnreachable # Number of pre-forked instances of pollers for unreachable hosts (including IPMI). # # Mandatory: no # Range: 0-1000 # Default: StartPollersUnreachable=8 //默认情况下,ZABBIX会启用指定进程用于探测某些不可达主机的(含IPMI场景);若使用场景中含有代理端,建议保持默认;若直接agent较多,可视具体情况调整 ### Option: StartTrappers # Number of pre-forked instances of trappers. # Trappers accept incoming connections from Zabbix sender, active agents, active proxies and child nodes. # At least one trapper process must be running to display server availability in the frontend. # # Mandatory: no # Range: 0-1000 # Default: StartTrappers=10 //用于设置诸如SNMP STRAPPER场景提交来的数据的接收进程数,若客户机SNMP TRAPPER技术较多,建议加大此参数值 ### Option: StartPingers # Number of pre-forked instances of ICMP pingers. # # Mandatory: no # Range: 0-1000 # Default: #StartPingers=40 StartPingers=60 //用于设置启用icmp协议PING主机方式启动线程数量,若单台代理所管理机器超过500台,建议加大此数值 ### Option: StartDiscoverers # Number of pre-forked instances of discoverers. # # Mandatory: no # Range: 0-250 # Default: StartDiscoverers=10 //用于设置自动发现主机的线程数量,若单台代理所管理机器超过500台,可以考虑加大此数值(仅适用于直接AGENT场景) ### Option: StartHTTPPollers # Number of pre-forked instances of HTTP pollers. # # Mandatory: no # Range: 0-1000 # Default: StartHTTPPollers=1 //用于设置WEB拨测监控线程数,可视具体情况增加或减少此数值。 ### Option: JavaGateway # IP address (or hostname) of Zabbix Java gateway. # Only required if Java pollers are started. # # Mandatory: no # Default: # JavaGateway= //JAVAGATEWAY 场景下使用 ### Option: JavaGatewayPort # Port that Zabbix Java gateway listens on. # # Mandatory: no # Range: 1024-32767 # Default: # JavaGatewayPort=10052 //JAVAGATEWAY 场景下使用 ### Option: StartJavaPollers # Number of pre-forked instances of Java pollers. # # Mandatory: no # Range: 0-1000 # Default: # StartJavaPollers=0 //JAVAGATEWAY 场景下使用 ### Option: SNMPTrapperFile # Temporary file used for passing data from SNMP trap daemon to the server. # Must be the same as in zabbix_trap_receiver.pl or SNMPTT configuration file. # # Mandatory: no # Default: SNMPTrapperFile=/tmp/zabbix_traps.tmp //指定SNMP TRAPPER 时的临时文件,用于代理端启用SNMP TRAPPER功能时使用 ### Option: StartSNMPTrapper # If 1, SNMP trapper process is started. # # Mandatory: no # Range: 0-1 # Default: StartSNMPTrapper=1 //指定SNMP TRAPPER 时的临时文件,用于代理端启用SNMP TRAPPER功能时使用 ### Option: ListenIP # List of comma delimited IP addresses that the trapper should listen on. # Trapper will listen on all network interfaces if this parameter is missing. # # Mandatory: no # Default: # ListenIP=0.0.0.0 # ListenIP=127.0.0.1 //启用SNMPTRAPPER里 ,接收端监听的IP,此参数与StartSNMPTrapper,SNMPTrapperFile 联合使用 ### Option: HousekeepingFrequency # How often Zabbix will perform housekeeping procedure (in hours). # Housekeeping is removing unnecessary information from history, alert, and alarms tables. # # Mandatory: no # Range: 1-24 # Default: # HousekeepingFrequency=1 //多少小时清理一次代理端数据库的 history, alert, and alarms,以保持代理端数据库轻便,建议保持默认 ### Option: MaxHousekeeperDelete # The table "housekeeper" contains "tasks" for housekeeping procedure in the format: # [housekeeperid], [tablename], [field], [value]. # No more than ‘MaxHousekeeperDelete‘ rows (corresponding to [tablename], [field], [value]) # will be deleted per one task in one housekeeping cycle. # SQLite3 does not use this parameter, deletes all corresponding rows without a limit. # If set to 0 then no limit is used at all. In this case you must know what you are doing! # # Mandatory: no # Range: 0-1000000 # Default: # MaxHousekeeperDelete=500 ### Option: DisableHousekeeping # If set to 1, disables housekeeping. # # Mandatory: no # Range: 0-1 # Default: DisableHousekeeping=1 //禁掉Housekeeping功能 ### Option: SenderFrequency # How often Zabbix will try to send unsent alerts (in seconds). # # Mandatory: no # Range: 5-3600 # Default: # SenderFrequency=30 //多少秒后重试发送失败的报警信息 ### Option: CacheSize # Size of configuration cache, in bytes. # Shared memory size for storing host, item and trigger data. # # Mandatory: no # Range: 128K-2G # Default: CacheSize=2048M //zabbix初始化时占用多少系统共享内存用于存储配置信息,HOST,ITEM,TRIGGER数据,视监控主机数量和监控项调整,建议调整到32M或者更大 ### Option: CacheUpdateFrequency # How often Zabbix will perform update of configuration cache, in seconds. # # Mandatory: no # Range: 1-3600 # Default: #CacheUpdateFrequency=600 CacheUpdateFrequency=900 //zabbix更新操作系统CACHE频率,若管理页面操作不频繁,可以考虑加大参数值 ### Option: StartDBSyncers # Number of pre-forked instances of DB Syncers # # Mandatory: no # Range: 1-100 # Default: StartDBSyncers=72 #StartDBSyncers=90 //将采集数据从CACHE同步到数据库线程数量,视数据库服务器I/O繁忙情况,和数据库写能力调整。数值越大,写能力越强。对数据库服务器I/O压力越大 ### Option: HistoryCacheSize # Size of history cache, in bytes. # Shared memory size for storing history data. # # Mandatory: no # Range: 128K-2G # Default: HistoryCacheSize=2048M //用于设置划分多少系统共享内存用于存储采集的历史数据,此数值越大,数据库读压力越小 ### Option: TrendCacheSize # Size of trend cache, in bytes. # Shared memory size for storing trends data. # # Mandatory: no # Range: 128K-2G # Default: TrendCacheSize=2048M //用于设置划分多少系统共享内存用于存储计算出来的趋势数据,此参数值从一定程度上可影响数据库读压力 ### Option: HistoryTextCacheSize # Size of text history cache, in bytes. # Shared memory size for storing character, text or log history data. # # Mandatory: no # Range: 128K-2G # Default: HistoryTextCacheSize=2048M ### Option: NodeNoEvents # Default: HistoryTextCacheSize=2048M //指定划出多少系统共享内存用于存储 character, text or log history数据,若二级代理内存足够,建议可适当扩大此数值,可很大程度上解决系统I/O压力,和数据库读压力 ### Option: NodeNoEvents # If set to ‘1‘ local events won‘t be sent to master node. # This won‘t impact ability of this node to propagate events from its child nodes. # # Mandatory: no # Range: 0-1 # Default: # NodeNoEvents=0 //若节点为子结点,是否允许本地事件(events表)发送到主节点,1为不发送,但不影响此节点以下的节点的传播能力,视ZABBIX分布式系统架构设计开启或关闭。在不明架构前提下,建议保持默认 ### Option: NodeNoHistory # If set to ‘1‘ local history won‘t be sent to master node. # This won‘t impact ability of this node to propagate history from its child nodes. # # Mandatory: no # Range: 0-1 # Default: # NodeNoHistory=0 //若节点为子结点,是否允许本地历史数据发送到主节点,1为不发送,但不影响此节点以下的节点的传播能力,视ZABBIX分布式系统架构设计开启或关闭,在不明架构前提下,建议保持默认 ### Option: Timeout # Specifies how long we wait for agent, SNMP device or external check (in seconds). # # Mandatory: no # Range: 1-30 # Default: Timeout=30 //与AGNET\SNMP设备和其它外部设备通信超时设置,单位为秒;若采集数据不完整或网络繁忙,或从管理页面发现客户端状态变化频繁,可以考虑加大此数值。注意若此数值加大,应该考虑参数 StartPollers 是否有相应加大的必要 ### Option: TrapperTimeout # Specifies how many seconds trapper may spend processing new data. # # Mandatory: no # Range: 1-300 # Default: # TrapperTimeout=30 //启用 trapper功能,用于进程等待超时设置。根据需要调整 ### Option: UnreachablePeriod # After how many seconds of unreachability treat a host as unavailable. # # Mandatory: no # Range: 1-3600 # Default: # UnreachablePeriod=45 UnreachablePeriod=150 //当AGNET端处于不可用状态下,间隔多少秒后,尝试重新连接。建议根据具体情况设置。注意,若此数值过小,右agent端业务系统繁忙时,有可能造成报警信息误报 ### Option: UnavailableDelay # How often host is checked for availability during the unavailability period, in seconds. # # Mandatory: no # Range: 1-3600 # Default: # UnavailableDelay=60 //当AGENT端处于可用状态下,间隔多少秒后,进行状态检查。若出现可正常采集数据,但管理页面AGENT状态不正常;若在网络,端口等均通畅情况下,AGENT状态仍不正常,可以考虑加大此数值 ### Option: UnreachableDelay # How often host is checked for availability during the unreachability period, in seconds. # # Mandatory: no # Range: 1-3600 # Default: # UnreachableDelay=15 UnreachableDelay=30 //当agent端处于不可达状态下,延迟多少秒后,进行重新尝试,建议保持默认,在AGENT接入调试阶段,可考虑减少此数值 ### Option: AlertScriptsPath # Full path to location of custom alert scripts. # Default depends on compilation options. # # Mandatory: no # Default: # AlertScriptsPath=${datadir}/zabbix/alertscripts //监控报警脚本路径 ### Option: ExternalScripts # Full path to location of external scripts. # Default depends on compilation options. # # Mandatory: no # Default: # ExternalScripts=${datadir}/zabbix/externalscripts //自定义脚本存储路径 ### Option: FpingLocation # Location of fping. # Make sure that fping binary has root ownership and SUID flag set. # # Mandatory: no # Default: FpingLocation=/usr/bin/fping //IPv4 FPING命令路径,仅ROOT可用。注意使用此命令时,应该确认此命令是否存在 ### Option: Fping6Location # Location of fping6. # Make sure that fping6 binary has root ownership and SUID flag set. # Make empty if your fping utility is capable to process IPv6 addresses. # # Mandatory: no # Default: # Fping6Location=/usr/sbin/fping6 //IPv6 FPING命令路径,仅ROOT可用。注意使用此命令时,应该确认此命令是否存在 ### Option: SSHKeyLocation # Location of public and private keys for SSH checks and actions # # Mandatory: no # Default: # SSHKeyLocation= //在服务端需要SSH到AGENT端且采用用KEY验证方式时使用 ### Option: LogSlowQueries # How long a database query may take before being logged (in milliseconds). # 0 - don‘t log slow queries. # # Mandatory: no # Range: 1-3600000 # Default: LogSlowQueries=1000 //用于服务端数据库慢查询功能,单位是毫秒;1毫秒=0.001秒,若有服务端数据库监控慢查询的需求,可以视具体情况调整此数 ### Option: TmpDir # Temporary directory. # # Mandatory: no # Default: # TmpDir=/tmp //zabbix服务端工作的临时目录 ### 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=/usr/local/etc/zabbix_server.general.conf # Include=/usr/local/etc/zabbix_server.conf.d/ //在一些情况下,软件的参数配置文件很长,为了方便管理,将配置文件切割成N个配置文件,但为了主配置参数文件的简洁,便会启用INCLUDE参数,以方便程序读取指定目录下的所有配置文件 ### Option: StartProxyPollers # Number of pre-forked instances of pollers for passive proxies. # # Mandatory: no # Range: 0-250 # Default: # StartProxyPollers=1 //启用多少子进程与代理端通信,若代理端较多可考虑加大此数值 ### Option: ProxyConfigFrequency # How often Zabbix Server sends configuration data to a Zabbix Proxy in seconds. # This parameter is used only for proxies in the passive mode. # # Mandatory: no # Range: 1-3600*24*7 # ProxyConfigFrequency=3600 //zabbix服务端将配置文件数据同步到代理端的频率,仅适用于代理端为被动模式情况 # How often Zabbix Server requests history data from a Zabbix Proxy in seconds. # This parameter is used only for proxies in the passive mode. # # Mandatory: no # Range: 1-3600 # Default: # ProxyDataFrequency=1 //zabbix服务端请求代理端采集的数据的频率,仅适用代理端为被动模式情况下 zabbix_agentd.conf # This is a config file for the Zabbix agent daemon (Unix) # To get more information about Zabbix, visit http://www.zabbix.com ############ GENERAL PARAMETERS ################# ### Option: PidFile # Name of PID file. # # Mandatory: no # Default: PidFile=/tmp/zabbix_agentd.pid //pid文件的存放位置 ### Option: LogFile # Name of log file. # If not set, syslog is used. # # Mandatory: no # Default: # LogFile= LogFile=/tmp/zabbix_agentd.log //日志文件的位置 ### Option: LogFileSize # Maximum size of log file in MB. # 0 - disable automatic log rotation. # # Mandatory: no # Range: 0-1024 # Default: LogFileSize=1024 //当日志文件达到多大时进行轮询操作 ### Option: DebugLevel # Specifies debug level # 0 - no debug # 1 - critical information # 2 - error information # 3 - warnings # 4 - for debugging (produces lots of information) # # Mandatory: no # Range: 0-4 # Default: DebugLevel=3 //日志信息(调试)级别 ### Option: SourceIP # Source IP address for outgoing connections. # # Mandatory: no # Default: # SourceIP= //连接的源ip地址,默认为空 ### Option: EnableRemoteCommands # Whether remote commands from Zabbix server are allowed. # 0 - not allowed # 1 - allowed # # Mandatory: no # Default: # 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 //是否开启日志记录shell命令作为警告 0表示不允许,1表示允许 ##### Passive checks related ### Option: Server # List of comma delimited IP addresses (or hostnames) of Zabbix servers. # Incoming connections will be accepted only from the hosts listed here. # No spaces allowed. # 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地址或主机名,可同时列出多个,需要用逗号隔开 ### Option: ListenPort # Agent will listen on this port for connections from the server. # # Mandatory: no # Range: 1024-32767 # Default: ListenPort=10050 //zabbix agent监听的端口 ### 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 //zabbix agent监听的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 //zabbix agent开启进程数 ##### Active checks related ### 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 //开启主动检查 ### 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 server前端配置时指定的主机名要相同,最重要的配置 ### Option: HostnameItem # Item used for generating Hostname if it is undefined. # Ignored if Hostname is defined. # # Mandatory: no # Default: # HostnameItem=system.hostname ### Option: RefreshActiveChecks # How often list of active checks is refreshed, in seconds. # # Mandatory: no # Range: 60-3600 # Default: RefreshActiveChecks=120 //主动检查刷新的时间,单位为秒数 ### Option: BufferSend # Do not keep data longer than N seconds in buffer. # # Mandatory: no # Range: 1-3600 # Default: 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=100 //zabbix agent数据缓冲区的大小,当达到该值便会发送所有的数据到zabbix server ### 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=100 //zabbix agent发送给zabbix server最大的数据行 ### 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 //是否允许zabbix agent 以root用户运行 ############ 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: ### Option: Timeout # Spend no more than Timeout seconds on processing # # Mandatory: no # Range: 1-30 # Default: Timeout=3 //设定处理超时的时间 ### 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=/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 //是否允许所有字符参数的传递 ### 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= //指定用户自定义参数 zabbix_proxy.conf 和zabbix_server.conf 类似 # This is a configuration file for Zabbix Proxy process # To get more information about Zabbix, # visit http://www.zabbix.com ############ GENERAL PARAMETERS ################# ### Option: ProxyMode # Proxy operating mode # 0 - proxy in the active mode # 1 - proxy in the passive mode # # Mandatory: no # Default: # ProxyMode=0 ### Option: Server # IP address (or hostname) of Zabbix server. # Active proxy will get configuration data from the server. # For a proxy in the passive mode this parameter will be ignored. # # Mandatory: yes (if ProxyMode is set to 0) # Default: # Server= Server=127.0.0.1 ### Option: ServerPort # Port of Zabbix trapper on Zabbix server. # For a proxy in the passive mode this parameter will be ignored. # # Mandatory: no # Range: 1024-32767 # Default: # ServerPort=10051 ### Option: Hostname # Unique, case sensitive Proxy name. Make sure the Proxy name is known to the server! # Value is acquired from HostnameItem if undefined. # # Mandatory: no # Default: # Hostname= Hostname=Zabbix proxy ### Option: HostnameItem # Item used for generating Hostname if it is undefined. # Ignored if Hostname is defined. # # Mandatory: no # Default: # HostnameItem=system.hostname ### Option: ListenPort # Listen port for trapper. # # Mandatory: no # Range: 1024-32767 # Default: # ListenPort=10051 ### Option: SourceIP # Source IP address for outgoing connections. # # Mandatory: no # Default: # SourceIP= ### Option: LogFile # Name of log file. # If not set, syslog is used. # # Mandatory: no # Default: # LogFile= LogFile=/tmp/zabbix_proxy.log ### Option: LogFileSize # Maximum size of log file in MB. # 0 - disable automatic log rotation. # # Mandatory: no # Range: 0-1024 # Default: # 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) # # Mandatory: no # Range: 0-4 # Default: # DebugLevel=3 ### Option: PidFile # Name of PID file. # # Mandatory: no # Default: # PidFile=/tmp/zabbix_proxy.pid ### Option: DBHost # Database host name. # If set to localhost, socket is used for MySQL. # If set to empty string, socket is used for PostgreSQL. # # Mandatory: no # Default: # DBHost=localhost ### Option: DBName # Database name. # For SQLite3 path to database file must be provided. DBUser and DBPassword are ignored. # Warning: do not attempt to use the same database Zabbix server is using. # # Mandatory: yes # Default: # DBName= DBName=zabbix_proxy ### Option: DBSchema # Schema name. Used for IBM DB2. # # Mandatory: no # Default: # DBSchema= ### Option: DBUser # Database user. Ignored for SQLite. # # Default: # DBUser= DBUser=root ### Option: DBPassword # Database password. Ignored for SQLite. # Comment this line if no password is used. # # Mandatory: no # Default: # DBPassword= ### Option: DBSocket # Path to MySQL socket. # # Mandatory: no # Default: # DBSocket=/tmp/mysql.sock # Option: DBPort # Database port when not using local socket. Ignored for SQLite. # # Mandatory: no # Default (for MySQL): # DBPort=3306 ######### PROXY SPECIFIC PARAMETERS ############# ### Option: ProxyLocalBuffer # Proxy will keep data locally for N hours, even if the data have already been synced with the server. # This parameter may be used if local data will be used by third party applications. # # Mandatory: no # Range: 0-720 # Default: # ProxyLocalBuffer=0 ### Option: ProxyOfflineBuffer # Proxy will keep data for N hours in case if no connectivity with Zabbix Server. # Older data will be lost. # # Mandatory: no # Range: 1-720 # Default: # ProxyOfflineBuffer=1 ### Option: HeartbeatFrequency # Frequency of heartbeat messages in seconds. # Used for monitoring availability of Proxy on server side. # 0 - heartbeat messages disabled. # For a proxy in the passive mode this parameter will be ignored. # # Mandatory: no # Range: 0-3600 # Default: # HeartbeatFrequency=60 ### Option: ConfigFrequency # How often proxy retrieves configuration data from Zabbix Server in seconds. # For a proxy in the passive mode this parameter will be ignored. # # Mandatory: no # Range: 1-3600*24*7 # Default: # ConfigFrequency=3600 ### Option: DataSenderFrequency # Proxy will send collected data to the Server every N seconds. # For a proxy in the passive mode this parameter will be ignored. # # Mandatory: no # Range: 1-3600 # Default: # DataSenderFrequency=1 ############ ADVANCED PARAMETERS ################ ### Option: StartPollers # Number of pre-forked instances of pollers. # # Mandatory: no # Range: 0-1000 # Default: # StartPollers=5 ### Option: StartIPMIPollers # Number of pre-forked instances of IPMI pollers. # # Mandatory: no # Range: 0-1000 # Default: # StartIPMIPollers=0 ### Option: StartPollersUnreachable # Number of pre-forked instances of pollers for unreachable hosts (including IPMI). # # Mandatory: no # Range: 0-1000 # Default: # StartPollersUnreachable=1 ### Option: StartTrappers # Number of pre-forked instances of trappers. # Trappers accept incoming connections from Zabbix sender and active agents. # # Mandatory: no # Range: 0-1000 # Default: # StartTrappers=5 ### Option: StartPingers # Number of pre-forked instances of ICMP pingers. # # Mandatory: no # Range: 0-1000 # Default: # StartPingers=1 ### Option: StartDiscoverers # Number of pre-forked instances of discoverers. # # Mandatory: no # Range: 0-250 # Default: # StartDiscoverers=1 ### Option: StartHTTPPollers # Number of pre-forked instances of HTTP pollers. # # Mandatory: no # Range: 0-1000 # Default: # StartHTTPPollers=1 ### Option: JavaGateway # IP address (or hostname) of Zabbix Java gateway. # Only required if Java pollers are started. # # Mandatory: no # Default: # JavaGateway= ### Option: JavaGatewayPort # Port that Zabbix Java gateway listens on. # # Mandatory: no # Range: 1024-32767 # Default: # JavaGatewayPort=10052 ### Option: StartJavaPollers # Number of pre-forked instances of Java pollers. # # Mandatory: no # Range: 0-1000 # Default: # StartJavaPollers=0 ### Option: SNMPTrapperFile # Temporary file used for passing data from SNMP trap daemon to the proxy. # Must be the same as in zabbix_trap_receiver.pl or SNMPTT configuration file. # # Mandatory: no # Default: # SNMPTrapperFile=/tmp/zabbix_traps.tmp ### Option: StartSNMPTrapper # If 1, SNMP trapper process is started. # # Mandatory: no # Range: 0-1 # Default: # StartSNMPTrapper=0 ### Option: ListenIP # List of comma delimited IP addresses that the trapper should listen on. # Trapper will listen on all network interfaces if this parameter is missing. # # Mandatory: no # Default: # ListenIP=0.0.0.0 ### Option: HousekeepingFrequency # How often Zabbix will perform housekeeping procedure (in hours). # Housekeeping is removing unnecessary information from history, alert, and alarms tables. # # Mandatory: no # Range: 1-24 # Default: # HousekeepingFrequency=1 ### Option: CacheSize # Size of configuration cache, in bytes. # Shared memory size, for storing hosts and items data. # # Mandatory: no # Range: 128K-2G # Default: # CacheSize=8M ### Option: StartDBSyncers # Number of pre-forked instances of DB Syncers # # Mandatory: no # Range: 1-100 # Default: # StartDBSyncers=4 ### Option: HistoryCacheSize # Size of history cache, in bytes. # Shared memory size for storing history data. # # Mandatory: no # Range: 128K-2G # Default: # HistoryCacheSize=8M ### Option: HistoryTextCacheSize # Size of text history cache, in bytes. # Shared memory size for storing character, text or log history data. # # Mandatory: no # Range: 128K-2G # Default: # HistoryTextCacheSize=16M ### Option: Timeout # Specifies how long we wait for agent, SNMP device or external check (in seconds). # # Mandatory: no # Range: 1-30 # Default: # Timeout=3 ### Option: TrapperTimeout # Specifies how many seconds trapper may spend processing new data. # # Mandatory: no # Range: 1-300 # Default: # TrapperTimeout=300 ### Option: UnreachablePeriod # After how many seconds of unreachability treat a host as unavailable. # # Mandatory: no # Range: 1-3600 # Default: # UnreachablePeriod=45 ### Option: UnavailableDelay # How often host is checked for availability during the unavailability period, in seconds. # # Mandatory: no # Range: 1-3600 # Default: # UnavailableDelay=60 ### Option: UnreachableDelay # How often host is checked for availability during the unreachability period, in seconds. # # Mandatory: no # Range: 1-3600 # Default: # UnreachableDelay=15 ### Option: ExternalScripts # Full path to location of external scripts. # Default depends on compilation options. # # Mandatory: no # Default: # ExternalScripts=${datadir}/zabbix/externalscripts ### Option: FpingLocation # Location of fping. # Make sure that fping binary has root ownership and SUID flag set. # # Mandatory: no # Default: # FpingLocation=/usr/sbin/fping ### Option: Fping6Location # Location of fping6. # Make sure that fping6 binary has root ownership and SUID flag set. # Make empty if your fping utility is capable to process IPv6 addresses. # # Mandatory: no # Default: # Fping6Location=/usr/sbin/fping6 ### Option: SSHKeyLocation # Location of public and private keys for SSH checks andactions # # Mandatory: no # Default: # SSHKeyLocation= ### Option: LogSlowQueries # How long a database query may take before being logged (in milliseconds). # 0 - don‘t log slow queries. # # Mandatory: no # Range: 1-3600000 # Default: # LogSlowQueries=0 ### Option: TmpDir # Temporary directory. # # Mandatory: no # Default: # TmpDir=/tmp ### 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=/usr/local/etc/zabbix_proxy.general.conf # Include=/usr/local/etc/zabbix_proxy.conf.d/ 三、实例 zabbix_server.conf # egrep -v "^$|^#" zabbix_server.conf ListenPort=10051 SourceIP=0.0.0.0 LogFile=/var/log/zabbix/zabbix_server.log LogFileSize=1024 DebugLevel=3 PidFile=/var/run/zabbix/zabbix_server.pid DBHost=10.249.17.52 DBName=zabbix DBUser=zabbix DBPassword=zabbix DBPort=3306 StartPollers=5 StartPollersUnreachable=8 StartTrappers=10 StartPingers=60 StartDiscoverers=10 StartHTTPPollers=1 SNMPTrapperFile=/tmp/zabbix_traps.tmp StartSNMPTrapper=1 CacheSize=2048M CacheUpdateFrequency=900 StartDBSyncers=20 HistoryCacheSize=2048M TrendCacheSize=2048M HistoryTextCacheSize=2048M Timeout=30 UnreachablePeriod=150 UnreachableDelay=30 FpingLocation=/usr/sbin/fping LogSlowQueries=1000 TmpDir=/tmp/zabbix-pinger zabbix_agentd.conf cat /usr/local/zabbix-agent-ops/etc/zabbix_agentd.conf PidFile=/usr/local/zabbix-agent-ops/var/zabbix_agentd.pid LogFile=/usr/local/zabbix-agent-ops/var/zabbix_agentd.log Server=10.10.3.234 ServerActive=10.10.3.234 Include=/usr/local/zabbix-agent-ops/etc/extra.conf Include=/usr/local/zabbix-agent-ops/etc/zabbix_agentd.conf.d/ /usr/local/zabbix-agent-ops/bin/ 目录下为自定义脚本 /usr/local/zabbix-agent-ops/etc/extra.conf 自定义key值 /usr/local/zabbix-agent-ops/etc/zabbix_agentd.conf.d/ 自定义key值 # iostat UserParameter=custom.vfs.dev.discovery,/usr/local/zabbix-agent-ops/bin/dev-discovery.sh UserParameter=iostat[*],/usr/local/zabbix-agent-ops/bin/iostat-check.sh $1 $2 zabbix_proxy.conf Server=192.168.100.100 #指定zabbix server的ip地址或主机名 Hostname=zabbix-proxy-1.35 #定义监控代理的主机名,需和zabbix server前端配置时指定的节点名相同 LogFile=/tmp/zabbix_proxy.log #指定日志文件的位置 PidFile=/tmp/zabbix_proxy.pid #pid文件的位置 DBName=zabbix_proxy #数据库名 DBUser=zabbix #连接数据库的用户 DBPassword=zabbix#连接数据库用户的密码 ConfigFrequency=60 #zabbix proxy从zabbix server取得配置数据的频率 DataSenderFrequency=60 #zabbix proxy发送监控到的数据给zabbix server的频率 参考文档:https://abnerzhao.gitbooks.io/zabbix/content/chapter4.html
标签:zabbix配置文件详解
原文地址:http://huhaiqing.blog.51cto.com/6338282/1937397