bco 发表于 2018-10-19 11:55:33

zabbix_server的配置文件讲解

# This is a configuration file for Zabbix server daemon  # To get more information about Zabbix, visit http://www.zabbix.com
  ############ GENERAL PARAMETERS #################
  ### Option: ListenPort
  #   Listen port for trapper.
  #
  # Mandatory: no
  # Range: 1024-32767
  # Default:
  #说明:服务端监听端口用于接收二级代理或直连AGENT的采集数据
  # ListenPort=10051
  ### Option: SourceIP
  #   Source IP address for outgoing connections.
  #
  # Mandatory: no
  # Default:
  #说明:服务端监听IP,建议指定
  # SourceIP=
  ### 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
  ### Option: LogFile
  #   Log file name for LogType 'file' parameter.
  #
  # Mandatory: no
  # Default:
  # LogFile=
  #说明:zabbix服务端日志路径,视具体情况指定
  LogFile=/tmp/zabbix_server.log
  ### Option: LogFileSize

  #   Maximum>  #   0 - disable automatic log rotation.
  #
  # Mandatory: no
  # Range: 0-1024
  # Default:
  #说明:日志达到多少M里就轮转;若此参数值为0时,则不轮转,日志将不断变大,建议设置成轮转
  LogFileSize=50
  ### Option: DebugLevel
  #   Specifies debug level:
  #   0 - basic information about starting and stopping of Zabbix processes
  #   1 - critical information灾难日志,日志量较少
  #   2 - error information错误级别,日志量大于CRITICAL级别
  #   3 - warnings    告警级别,日志量大于ERROR级别
  #   4 - for debugging (produces lots of information)调试级别,日志量大于WARNING
  #   5 - extended debugging (produces even more information)
  #
  # Mandatory: no
  # Range: 0-5
  # Default:
  #说明:日志级别0~4,单位时间内生成日志的量不断增大
  DebugLevel=3
  ### Option: PidFile
  #   Name of PID file.
  #
  # Mandatory: no
  # Default:
  #说明:zabbix服务端程序PID路径
  PidFile=/tmp/zabbix_server.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:
  #说明:指定数据库信息,对于mysql,若设置为localhost则mysql用SOCKET来连接(需配合参数 DBSocket 使用),否则用IP连接;若DHHOST值为空,则默认连接PostgreSQL
  # DBHost=localhost
  DBHost=
  ### Option: DBName
  #   Database name.
  #   For SQLite3 path to database file must be provided. DBUser and DBPassword are ignored.
  #
  # Mandatory: yes
  # Default:
  # DBName=
  #说明:服务端连接数据库的库名
  DBName=
  ### Option: DBSchema
  #   Schema name. Used for IBM DB2 and PostgreSQL.
  #
  # Mandatory: no
  # Default:
  #说明:专门用于 IBM DB2数据库的连接信息
  # DBSchema=
  ### Option: DBUser
  #   Database user. Ignored for SQLite.
  #
  # Mandatory: no
  # Default:
  #说明:连接数据库的用户
  # DBUser=
  DBUser=
  ### 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:
  #说明:指定MYSQL的SOCK连接路径
  DBSocket=/tmp/mysql.sock
  ### Option: DBPort
  #   Database port when not using local socket. Ignored for SQLite.
  #
  # Mandatory: no
  # Range: 1024-65535
  # Default (for MySQL):
  #说明:指定连接数据库的端口,默认3306
  DBPort=3306
  ############ ADVANCED PARAMETERS ################
  #高级参数
  ### Option: StartPollers
  #   Number of pre-forked instances of pollers.
  #
  # Mandatory: no
  # Range: 0-1000
  # Default:
  #说明;初始化时,启动子进程数量,数量越多,则服务端吞吐能力越强,对系统资源消耗越大
  StartPollers=300
  ### Option: StartIPMIPollers
  #   Number of pre-forked instances of IPMI pollers.
  #
  # Mandatory: no
  # Range: 0-1000
  # Default:
  #
  #说明:主要用于IPmi技术用于获取硬件状态场景。若无相关监控项,建议设置为0
  # StartIPMIPollers=0
  ### Option: StartPollersUnreachable
  #   Number of pre-forked instances of pollers for unreachable hosts (including IPMI and Java).
  #   At least one poller for unreachable hosts must be running if regular, IPMI or Java pollers
  #   are started.
  #
  # Mandatory: no
  # Range: 0-1000
  # Default:
  #说明:默认情况下,ZABBIX会启用指定进程用于探测某些不可达主机的(含IPMI场景);若使用场景中含有代理端,建议保持默认;若直接agent较多,可视具体情况调整
  StartPollersUnreachable=50
  ### Option: StartTrappers
  #   Number of pre-forked instances of trappers.
  #   Trappers accept incoming connections from Zabbix sender, active agents and active proxies.
  #   At least one trapper process must be running to display server availability and view queue
  #   in the frontend.
  #
  # Mandatory: no
  # Range: 0-1000
  # Default:
  #说明:用于设置诸如SNMP STRAPPER场景提交来的数据的接收进程数,若客户机SNMP TRAPPER技术较多,建议加大此参数值
  StartTrappers=50
  ### Option: StartPingers
  #   Number of pre-forked instances of ICMP pingers.
  #
  # Mandatory: no
  # Range: 0-1000
  # Default:
  #说明:用于设置启用icmp协议PING主机方式启动线程数量,若单台代理所管理机器超过500台,建议加大此数值
  # StartPingers=10
  ### Option: StartDiscoverers
  #   Number of pre-forked instances of discoverers.
  #
  # Mandatory: no
  # Range: 0-250
  # Default:
  #说明:用于设置自动发现主机的线程数量,若单台代理所管理机器超过500台,可以考虑加大此数值(仅适用于直接AGENT场景)
  StartDiscoverers=15
  ### Option: StartHTTPPollers
  #   Number of pre-forked instances of HTTP pollers.
  #
  # Mandatory: no
  # Range: 0-1000
  # Default:
  #说明:用于设置WEB拨测监控线程数,可视具体情况增加或减少此数值。
  # StartHTTPPollers=1
  ### Option: StartTimers
  #   Number of pre-forked instances of timers.
  #   Timers process time-based trigger functions and maintenance periods.
  #   Only the first timer process handles the maintenance periods.
  #
  # Mandatory: no
  # Range: 1-1000
  # Default:
  #说明:各实例计时器数量,主要用于触发器,标有维护标识的主机,但只第一个计时器用于计算维护标识主机。
  # StartTimers=1
  ### Option: StartEscalators
  #   Number of pre-forked instances of escalators.
  #
  # Mandatory: no
  # Range: 0-100
  # Default:
  #说明:用于处理动作中的步骤的进程,zabbix动作较多时建议调大。
  StartEscalators=30
  ### Option: JavaGateway
  #   IP address (or hostname) of Zabbix Java gateway.
  #   Only required if Java pollers are started.
  #
  # Mandatory: no
  # Default:
  #说明:JAVAGATEWAY 场景下使用
  JavaGateway=10.238.0.180
  ### Option: JavaGatewayPort
  #   Port that Zabbix Java gateway listens on.
  #
  # Mandatory: no
  # Range: 1024-32767
  # Default:
  #说明:JAVAGATEWAY 场景下使用
  JavaGatewayPort=10052
  ### Option: StartJavaPollers
  #   Number of pre-forked instances of Java pollers.
  #
  # Mandatory: no
  # Range: 0-1000
  # Default:
  #说明:JAVAGATEWAY 场景下使用
  StartJavaPollers=30
  ### Option: StartVMwareCollectors
  #   Number of pre-forked vmware collector instances.
  #
  # Mandatory: no
  # Range: 0-250
  # Default:
  #说明:用于设置监控VMWARE Esxi主机实例时使用,若为0则不启用,若要监控ESXI主机,此值最少为1 ;视监控ESXI数量设置对应数值
  # StartVMwareCollectors=0
  ### Option: VMwareFrequency
  #   How often Zabbix will connect to VMware service to obtain a new data.
  #
  # Mandatory: no
  # Range: 10-86400
  # Default:
  #说明:代理端访问 VMWARE service的频率,单位:秒
  # VMwareFrequency=60
  ### Option: VMwarePerfFrequency
  #   How often Zabbix will connect to VMware service to obtain performance data.
  #
  # Mandatory: no
  # Range: 10-86400
  # Default:
  # VMwarePerfFrequency=60
  ### Option: VMwareCacheSize

  #>
  #   Shared memory>  #   Only used if VMware collectors are started.
  #
  # Mandatory: no
  # Range: 256K-2G
  # Default:
  #说明:划出多少共享内存用于存储VMWARE数据
  VMwareCacheSize=256M
  ### Option: VMwareTimeout
  #   Specifies how many seconds vmware collector waits for response from VMware service.
  #
  # Mandatory: no
  # Range: 1-300
  # Default:
  #说明:等待VMWare返回数据的最长时间
  VMwareTimeout=10
  ### 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:
  #说明:指定SNMP TRAPPER 时的临时文件,用于代理端启用SNMP TRAPPER功能时使用
  # SNMPTrapperFile=/tmp/zabbix_traps.tmp
  ### Option: StartSNMPTrapper
  #   If 1, SNMP trapper process is started.
  #
  # Mandatory: no
  # Range: 0-1
  # Default:
  #说明:是否启用 snmptrapper功能 ,默认不启用=0,启用=1(配合参数SNMPTrapperFile使用)
  # 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:
  #说明:启用SNMPTRAPPER里 ,接收端监听的IP,此参数与StartSNMPTrapper,SNMPTrapperFile 联合使用
  # ListenIP=0.0.0.0
  ListenIP=10.238.0.180
  ### Option: HousekeepingFrequency
  #   How often Zabbix will perform housekeeping procedure (in hours).
  #   Housekeeping is removing outdated information from the database.
  #   To prevent Housekeeper from being overloaded, no more than 4 times HousekeepingFrequency
  #   hours of outdated information are deleted in one housekeeping cycle, for each item.
  #   To lower load on server startup housekeeping is postponed for 30 minutes after server start.
  #   With HousekeepingFrequency=0 the housekeeper can be only executed using the runtime control option.
  #   In this case the period of outdated information deleted in one housekeeping cycle is 4 times the
  #   period since the last housekeeping cycle, but not less than 4 hours and not greater than 4 days.
  #
  # Mandatory: no
  # Range: 0-24
  # Default:
  #说明:多少小时清理一次代理端数据库的 history, alert, and alarms,以保持代理端数据库轻便,建议保持默认
  HousekeepingFrequency=24
  ### Option: MaxHousekeeperDelete
  #   The table "housekeeper" contains "tasks" for housekeeping procedure in the format:
  #   , , , .
  #   No more than 'MaxHousekeeperDelete' rows (corresponding to , , )
  #   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:
  #说明:每个HouseKeeper任务删除的最大记录数,1.8.2开始支持
  MaxHousekeeperDelete=1000000
  ### Option: SenderFrequency
  #   How often Zabbix will try to send unsent alerts (in seconds).
  #
  # Mandatory: no
  # Range: 5-3600
  # Default:
  #说明:多少秒后重试发送失败的报警信息
  SenderFrequency=30
  ### Option: CacheSize

  #>
  #   Shared memory>  #
  # Mandatory: no
  # Range: 128K-8G
  # Default:
  #说明;zabbix初始化时占用多少系统共享内存用于存储配置信息,HOST,ITEM,TRIGGER数据,视监控主机数量和监控项调整,建议调整到32M或者更大
  CacheSize=8G
  ### Option: CacheUpdateFrequency
  #   How often Zabbix will perform update of configuration cache, in seconds.
  #
  # Mandatory: no
  # Range: 1-3600
  # Default:
  #说明:zabbix更新操作系统CACHE频率,若管理页面操作不频繁,可以考虑加大参数值
  CacheUpdateFrequency=300
  ### Option: StartDBSyncers
  #   Number of pre-forked instances of DB Syncers.
  #
  # Mandatory: no
  # Range: 1-100
  # Default:
  #说明:将采集数据从CACHE同步到数据库线程数量,视数据库服务器I/O繁忙情况,和数据库写能力调整。数值越大,写能力越强。对数据库服务器I/O压力越大。
  StartDBSyncers=20
  ### Option: HistoryCacheSize

  #>
  #   Shared memory>  #
  # Mandatory: no
  # Range: 128K-2G
  # Default:
  #说明:用于设置划分多少系统共享内存用于存储采集的历史数据,此数值越大,数据库读压力越小
  HistoryCacheSize=2048M
  ### Option: HistoryIndexCacheSize

  #>
  #   Shared memory>  #
  # Mandatory: no
  # Range: 128K-2G
  # Default:
  #说明:3.0.0开始支持,历史索引大小,一个监控项需要100bytes来存储
  HistoryIndexCacheSize=2048M
  ### Option: TrendCacheSize

  #>
  #   Shared memory>  #
  # Mandatory: no
  # Range: 128K-2G
  # Default:
  #说明:用于设置划分多少系统共享内存用于存储计算出来的趋势数据,此参数值从一定程度上可影响数据库读压力
  TrendCacheSize=512M
  ### Option: ValueCacheSize

  #>
  #   Shared memory>  #   Setting to 0 disables value cache.
  #
  # Mandatory: no
  # Range: 0,128K-64G
  # Default:
  #说明:划出系统多少共享内存用于已请求的存储监控项信息,若监控项较多,建议加大此数值
  ValueCacheSize=16G
  ### Option: Timeout
  #   Specifies how long we wait for agent, SNMP device or external check (in seconds).
  #
  # Mandatory: no
  # Range: 1-30
  # Default:
  # Timeout=3
  #说明:与AGNET\SNMP设备和其它外部设备通信超时设置,单位为秒;若采集数据不完整或网络繁忙,或从管理页面发现客户端状态变化频繁,可以考虑加大此数值。注意若此数值加大,应该考虑参数 StartPollers 是否有相应加大的必要。
  Timeout=10
  ### Option: TrapperTimeout
  #   Specifies how many seconds trapper may spend processing new data.
  #
  # Mandatory: no
  # Range: 1-300
  # Default:
  #说明:启用 trapper功能,用于进程等待超时设置。根据需要调整
  TrapperTimeout=50
  ### Option: UnreachablePeriod
  #   After how many seconds of unreachability treat a host as unavailable.
  #
  # Mandatory: no
  # Range: 1-3600
  # Default:
  #说明:当AGNET端处于不可用状态下,间隔多少秒后,尝试重新连接。建议根据具体情况设置。注意,若此数值过小,右agent端业务系统繁忙时,有可能造成报警信息误报
  # UnreachablePeriod=45
  ### Option: UnavailableDelay
  #   How often host is checked for availability during the unavailability period, in seconds.
  #
  # Mandatory: no
  # Range: 1-3600
  # Default:
  #说明:当AGENT端处于可用状态下,间隔多少秒后,进行状态检查。若出现可正常采集数据,但管理页面AGENT状态不正常;若在网络,端口等均通畅情况下,AGENT状态仍不正常,可以考虑加大此数值
  # UnavailableDelay=60
  ### Option: UnreachableDelay
  #   How often host is checked for availability during the unreachability period, in seconds.
  #
  # Mandatory: no
  # Range: 1-3600
  # Default:
  #说明:当agent端处于不可达状态下,延迟多少秒后,进行重新尝试,建议保持默认,在AGENT接入调试阶段,可考虑减少此数值
  # UnreachableDelay=15
  ### Option: AlertScriptsPath
  #   Full path to location of custom alert scripts.
  #   Default depends on compilation options.
  #
  # Mandatory: no
  # Default:
  #说明:监控报警脚本路径,非研发人员不建议修改此参数值
  # AlertScriptsPath=${datadir}/zabbix/alertscripts
  AlertScriptsPath=/home/zabbix/bin
  ### 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:
  #说明:IPv4 FPING命令路径,仅ROOT可用。注意使用此命令时,应该确认此命令是否存在
  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:
  #说明:IPv6 FPING命令路径,仅ROOT可用。注意使用此命令时,应该确认此命令是否存在
  # Fping6Location=/usr/sbin/fping6
  ### Option: SSHKeyLocation
  #   Location of public and private keys for SSH checks and actions.
  #
  # Mandatory: no
  # Default:
  #说明:在服务端需要SSH到AGENT端且采用用KEY验证方式时使用。非研发人员,不建议修改或设置
  # SSHKeyLocation=
  ### Option: LogSlowQueries
  #   How long a database query may take before being logged (in milliseconds).
  #   Only works if DebugLevel set to 3, 4 or 5.
  #   0 - don't log slow queries.
  #
  # Mandatory: no
  # Range: 1-3600000
  # Default:
  #说明:用于服务端数据库慢查询功能,单位是毫秒;1毫秒=0.001秒,若有服务端数据库监控慢查询的需求,可以视具体情况调整此数。
  # LogSlowQueries=0
  LogSlowQueries=3000
  ### Option: TmpDir
  #   Temporary directory.
  #
  # Mandatory: no
  # Default:
  #说明:zabbix服务端工作的临时目录
  # TmpDir=/tmp
  ### 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
  # Default:
  #说明:zabbix服务端将配置文件数据同步到代理端的频率,仅适用于代理端为被动模式情况下
  # ProxyConfigFrequency=3600
  ### Option: ProxyDataFrequency
  #   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:
  #说明:zabbix服务端请求代理端采集的数据的频率,仅适用代理端为被动模式情况下
  # ProxyDataFrequency=1
  ### Option: AllowRoot
  #   Allow the server to run as 'root'. If disabled and the server is started by 'root', the server
  #   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:
  #说明:是否允许以root身份运行服务端
  AllowRoot=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:
  #说明:非root运行的账号
  # User=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:
  #说明:在一些情况下,软件的参数配置文件很长,为了方便管理,将配置文件切割成N个配置文件,但为了主配置参数文件的简洁,便会启用INCLUDE参数,以方便程序读取指定目录下的所有配置文件
  # Include=
  # Include=/usr/local/etc/zabbix_server.general.conf
  # Include=/usr/local/etc/zabbix_server.conf.d/
  # Include=/usr/local/etc/zabbix_server.conf.d/*.conf
  ### Option: SSLCertLocation
  #   Location of SSL client certificates.
  #   This parameter is used only in web monitoring.
  #
  # Mandatory: no
  # Default:
  #说明:SSL客户端认证文件,2.4开始支持
  # SSLCertLocation=${datadir}/zabbix/ssl/certs
  ### Option: SSLKeyLocation
  #   Location of private keys for SSL client certificates.
  #   This parameter is used only in web monitoring.
  #
  # Mandatory: no
  # Default:
  #说明:SSL私钥文件目录,2.4开始支持
  # SSLKeyLocation=${datadir}/zabbix/ssl/keys
  ### Option: SSLCALocation
  #   Override the location of certificate authority (CA) files for SSL server certificate verification.
  #   If not set, system-wide directory will be used.
  #   This parameter is used only in web monitoring and SMTP authentication.
  #
  # Mandatory: no
  # Default:
  #说明:SSL CA钥文件目录,2.4开始支持
  # SSLCALocation=
  ####### LOADABLE MODULES #######
  #可加载的模块
  ### Option: LoadModulePath
  #   Full path to location of server modules.
  #   Default depends on compilation options.
  #
  # Mandatory: no
  # Default:
  #指定本地模块路径,非研发人员不建议修改
  # LoadModulePath=${libdir}/modules
  ### Option: LoadModule
  #   Module to load at server startup. Modules are used to extend functionality of the server.
  #   Format: LoadModule=
  #   The modules must be located in directory specified by LoadModulePath.
  #   It is allowed to include multiple LoadModule parameters.
  #
  # Mandatory: no
  # Default:
  #指定本地模块路径,非研发人员不建议修改
  # LoadModule=
  ####### TLS-RELATED PARAMETERS #######
  #TLS 相关参数
  ### Option: TLSCAFile
  #   Full pathname of a file containing the top-level CA(s) certificates for
  #   peer certificate verification.
  #
  # Mandatory: no
  # Default:
  #说明:TLS证书文件
  # TLSCAFile=
  ### Option: TLSCRLFile
  #   Full pathname of a file containing revoked certificates.
  #
  # Mandatory: no
  # Default:
  #说明:TLS证书文件
  # TLSCRLFile=
  ### Option: TLSCertFile
  #   Full pathname of a file containing the server certificate or certificate chain.
  #
  # Mandatory: no
  # Default:
  #说明:TLS证书文件
  # TLSCertFile=
  ### Option: TLSKeyFile
  #   Full pathname of a file containing the server private key.
  #
  # Mandatory: no
  # Default:
  #说明:TLS证书文件
  # TLSKeyFile=

页: [1]
查看完整版本: zabbix_server的配置文件讲解