美文网首页Zabbixzabbix
zabbix server配置优化

zabbix server配置优化

作者: 前浪浪奔浪流 | 来源:发表于2022-04-18 17:42 被阅读0次

    我的配置文件:

    egrep -v "^$|^#"  /usr/local/zabbix/etc/zabbix_server.conf
    ListenPort=10051
    LogType=file
    LogFile=/tmp/zabbix_server.log
    LogFileSize=100
    DebugLevel=3
    PidFile=/tmp/zabbix_server.pid
    DBHost=127.0.0.1
    DBName=zabbix
    DBUser=zabbix
    DBPassword=zabbix123
    DBPort=5432
    StartPollers=80
    StartIPMIPollers=0
    StartPollersUnreachable=1
    StartTrappers=5
    StartPingers=10
    StartDiscoverers=2
    StartHTTPPollers=5
    StartEscalators=20
    ListenIP=0.0.0.0
    CacheSize=1G
    CacheUpdateFrequency=300
    StartDBSyncers=6
    HistoryCacheSize=256M
    HistoryIndexCacheSize=256M
    TrendCacheSize=256M
    ValueCacheSize=256M
    Timeout=30
    UnreachablePeriod=45
    UnavailableDelay=60
    UnreachableDelay=15
    AlertScriptsPath=/usr/local/zabbix/share/zabbix/alertscripts
    LogSlowQueries=3000
    
    image.png
    Zabbix Server端配置文件说明
    # 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:
    **#说明:服务端节点Id,0表示只有一台服务端;主要用于服务端分布式部署时,视使用者设计ZABBIX系统架构调整**
    # NodeID=0
    
    
    ### 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: LogFile
    #   Name of log file.
    #   If not set, syslog is used.
    # Mandatory: no
    # Default:
    # LogFile=
    **#说明:zabbix服务端日志路径,视具体情况指定**
    **LogFile=/smp/sncmon/zabbix_server.log**
    
    ### Option: LogFileSize
    #   Maximum size of log file in MB.
    #   0 - disable automatic log rotation.
    # Mandatory: no
    # Range: 0-1024
    # Default:
    **#说明:日志达到多少M里就轮转;若此参数值为0时,则不轮转,日志将不断变大,建议设置成轮转**
    # LogFileSize=1
    
    ### 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:
    **#说明:日志级别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](http://www.it165.net/database/dbmy/).
    #   If set to empty string, socket is used for PostgreSQL.
    # Mandatory: no
    # Default:
    **#说明:指定数据库信息,对于mysql,若设置为localhost则mysql用SOCKET来连接(需配合参数 DBSocket 使用),否则用IP连接;若DHHOST值为空,则默认连接PostgreSQL**
    # DBHost=localhost
    
    ### Option: DBName
    #   Database name.
    #   For SQLite3 path to database file must be provided. DBUser and DBPassword are ignored.
    # Mandatory: yes
    # Default:
    # DBName=
    **#说明:服务端连接数据库的库名**
    DBName=smp
    
    ### Option: DBSchema
    #   Schema name. Used for IBM DB2.
    # Mandatory: no
    # Default:
    **#说明:专门用于 IBM DB2数据库的连接信息**
    # DBSchema=
    
    ### Option: DBUser
    #   Database user. Ignored for SQLite.
    # Mandatory: no
    # Default:
    **#说明:连接数据库的用户**
    # DBUser=
    DBUser=root
    
    ### Option: DBPassword
    #   Database password. Ignored for SQLite.
    #   Comment this line if no password is used.
    # Mandatory: no
    # Default:
    **#说明:连接数据库的密码**
    DBPassword=123
    
    ### Option: DBSocket
    #   Path to [MySQL](http://www.it165.net/database/dbmy/) 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):
    **#说明:指定连接数据库的端口**
    DBPort=3306
    
    ############ ADVANCED PARAMETERS ################
    #高级参数
    ### Option: StartPollers
    #   Number of pre-forked instances of pollers.
    # Mandatory: no
    # Range: 0-1000   基本轮询进程数,范围0-1000。
    # Default:
    **#说明;初始化时,启动子进程数量,数量越多,则服务端吞吐能力越强,对系统资源消耗越大**
    #轮询进程数,通过并发来提高轮询或者捕获的效率,同时用来避免poller busy问题,根据CPU数量与系统负载综合调优。
    StartPollers=5
    
    ### Option: StartIPMIPollers
    #   Number of pre-forked instances of IPMI pollers.
    # Mandatory: no
    # Range: 0-1000
    # Default:
    #**说明:主要用于IPMI技术用于获取硬件状态场景。IPMI轮询进程数,若无相关监控项,建议设置为0**
    # StartIPMIPollers=0
    
    ### Option: StartPollersUnreachable
    #   Number of pre-forked instances of pollers for unreachable hosts (including IPMI).
    # Mandatory: no
    # Range: 0-1000
    # Default:
    **#说明:默认情况下,ZABBIX会启用指定进程用于探测某些不可达主机的(含IPMI场景);若使用场景中含有代理端,建议保持默认;若直接agent较多,可视具体情况调整;不可达主机的轮询进程数,包括IPMI和JAVA。**
    # StartPollersUnreachable=1
    
    ### 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:
    **说明:用于设置诸如SNMP STRAPPER场景提交来的数据的接收进程数,若客户机SNMP TRAPPER技术较多,建议加大此参数值,若无active模式的客户端,则可减小该进程。**
    # StartTrappers=5
    
    ### Option: StartPingers
    #   Number of pre-forked instances of ICMP pingers.
    # Mandatory: no
    # Range: 0-1000
    # Default:
    **#说明:用于设置启用icmp协议PING主机方式启动线程数量,若单台代理所管理机器超过500台,建议加大此数值,ICMP ping数量,当大量使用ping用于心跳检测时,可适量增加。**
    # StartPingers=1
    
    ### Option: StartDiscoverers
    #   Number of pre-forked instances of discoverers.
    # Mandatory: no
    # Range: 0-250
    # Default:
    **说明:用于设置自动发现主机的线程数量,若单台代理所管理机器超过500台,可以考虑加大此数值(仅适用于直接AGENT场景)自动发现实例数,若关闭此功能则减少该数量。**
    # StartDiscoverers=1
    
    ### Option: StartHTTPPollers
    #   Number of pre-forked instances of HTTP pollers.
    # Mandatory: no
    # Range: 0-1000
    # Default:
    **#说明:用于设置WEB拨测监控线程数,可视具体情况增加或减少此数值。HTTP轮询实例数,当使用到内置的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: 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:
    **#说明:JAVAGATEWAY 场景下使用**
    # JavaGatewayPort=10052
    
    ### Option: StartJavaPollers
    #   Number of pre-forked instances of Java pollers.
    # Mandatory: no
    # Range: 0-1000
    # Default:
    **#说明:JAVAGATEWAY 场景下使用,JAVA轮询实例,当大量监控JMX时需要增加此项**
    # StartJavaPollers=0
    
    ### 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: VMwareCacheSize
    #   Size of VMware cache, in bytes.
    #   Shared memory size for storing VMware data.
    #   Only used if VMware collectors are started.
    # Mandatory: no
    # Range: 256K-2G
    # Default:
    **#说明:划出多少共享内存用于存储VMWARE数据**
    # VMwareCacheSize=8M
    
    ### 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=127.0.0.1
    
    ### 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:
    **#说明:多少小时清理一次代理端数据库的 history, alert, and alarms,以保持代理端数据库轻便,建议保持默认**
    # HousekeepingFrequency=1
    
    ### 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: 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:
    **#说明;zabbix初始化时占用多少系统共享内存用于存储配置信息,HOST,ITEM,TRIGGER数据,视监控主机数量和监控项调整,建议调整到32M或者更大**
    # CacheSize=8M
    
    ### Option: CacheUpdateFrequency
    #   How often Zabbix will perform update of configuration cache, in seconds.
    # Mandatory: no
    # Range: 1-3600
    # Default:
    **#说明:zabbix更新操作系统CACHE频率,若管理页面操作不频繁,可以考虑加大参数值**
    # CacheUpdateFrequency=60
    
    ### Option: StartDBSyncers
    #   Number of pre-forked instances of DB Syncers
    # Mandatory: no
    # Range: 1-100
    # Default:
    **#说明:将采集数据从CACHE同步到数据库线程数量,视数据库服务器I/O繁忙情况,和数据库写能力调整。数值越大,写能力越强。对数据库服务器I/O压力越大。**
    ****# 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: TrendCacheSize
    #   Size of trend cache, in bytes.
    #   Shared memory size for storing trends data.
    # Mandatory: no
    # Range: 128K-2G
    # Default:
    **#说明:用于设置划分多少系统共享内存用于存储计算出来的趋势数据,此参数值从一定程度上可影响数据库读压力**
    # TrendCacheSize=4M
    
    ### 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:
    **#说明:指定划出多少系统共享内存用于存储 character, text or log history数据,若二级代理内存足够,建议可适当扩大此数值,可很大程度上解决系统I/O压力,和数据库读压力**
    # HistoryTextCacheSize=16M
    
    ### Option: ValueCacheSize
    #   Size of history value cache, in bytes.
    #   Shared memory size for caching item history data requests
    #   Setting to 0 disables value cache.
    # Mandatory: no
    # Range: 0,128K-64G
    # Default:
    **#说明:划出系统多少共享内存用于已请求的存储监控项信息,若监控项较多,建议加大此数值**
    # ValueCacheSize=8M
    
    ### 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:
    **#说明:若节点为子结点,是否允许本地事件(events表)发送到主节点,1为不发送,但不影响此节点以下的节点的传播能力,视ZABBIX分布式系统架构设计开启或关闭。在不明架构前提下,建议保持默认**
    ****# NodeNoEvents=0****
    
    ### 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:
    **说明:若节点为子结点,是否允许本地历史数据发送到主节点,1为不发送,但不影响此节点以下的节点的传播能力,视ZABBIX分布式系统架构设计开启或关闭,在不明架构前提下,建议保持默认**
    # NodeNoHistory=0
    
    ### Option: Timeout
    #   Specifies how long we wait for agent, SNMP device or external check (in seconds).
    # Mandatory: no
    # Range: 1-30
    # Default:
    **#说明:与AGNET\SNMP设备和其它外部设备通信超时设置,单位为秒;若采集数据不完整或网络繁忙,或从管理页面发现客户端状态变化频繁,可以考虑加大此数值。注意若此数值加大,应该考虑参数 StartPollers 是否有相应加大的必要。**
    # Timeout=3
    
    ### Option: TrapperTimeout
    #   Specifies how many seconds trapper may spend processing new data.
    # Mandatory: no
    # Range: 1-300
    # Default:
    **#说明:启用 trapper功能,用于进程等待超时设置。根据需要调整**
    # TrapperTimeout=300
    
    ### 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
    
    ### 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 or 4.
    #   0 - don't log slow queries.
    # Mandatory: no
    # Range: 1-3600000
    # Default:
    **#说明:用于服务端数据库慢查询功能,单位是毫秒;1毫秒=0.001秒,若有服务端数据库监控慢查询的需求,可以视具体情况调整此数。**
    # LogSlowQueries=0
    
    ### 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 user 'zabbix' instead. Has no effect if started under a regular user.
    #   0 - do not allow 不允许
    #   1 - allow 允许
    # Mandatory: no
    # Default:
    **#说明:是否允许以root身份运行服务端**
    # AllowRoot=0
    
    ### Option: Include
    #   You may include individual files or all files in a directory in the configuration file.
    #   InstallingZabbix 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/
    
    ####### 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=<module.so>
    #   The modules must be located in directory specified by LoadModulePath.
    #   It is allowed to include multiple LoadModule parameters.
    # Mandatory: no
    # Default:
    **#指定本地模块路径,非研发人员不建议修改**
    # LoadModule=
    
    image.png image.png

    相关文章

      网友评论

        本文标题:zabbix server配置优化

        本文链接:https://www.haomeiwen.com/subject/fqpdertx.html