溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

zabbix 服務(wù)端配置詳解以及經(jīng)驗(yàn)參數(shù)

發(fā)布時(shí)間:2020-05-31 11:07:51 來源:網(wǎng)絡(luò) 閱讀:271 作者:laihuadongcto 欄目:系統(tǒng)運(yùn)維

zabbix 服務(wù)器端優(yōu)化

zabbix的參數(shù)除了保證服務(wù)正常運(yùn)行以外,還會(huì)影響到服務(wù)器的性能,如果設(shè)置的不合理可能會(huì)導(dǎo)致服務(wù)器的性能嚴(yán)重下降,經(jīng)常CPU占用過高或者是IO占用過高,最近我們的監(jiān)控系統(tǒng)就出現(xiàn)了類似的情況,數(shù)據(jù)庫(kù)負(fù)載以及IO讀寫特別的高,所以這里我對(duì)zabbix_server的配置文件再次進(jìn)行一次詳細(xì)的理解,并且修改和優(yōu)化了配置的參數(shù)。具體如下:
### Option: ListenPort
# Listen port for trapper.
//該參數(shù)用于指定服務(wù)端的監(jiān)聽端口,用于監(jiān)聽Proxy或Agent的連接請(qǐng)求。
# ListenPort=10051

### Option: SourceIP
# Source IP address for outgoing connections.
//該參數(shù)用于指定服務(wù)端的IP地址。
# SourceIP=

### Option: LogType
# Specifies where log messages are written?to://zabbix的日志類型
# system - syslog //寫入到系統(tǒng)日志
# file - file specified with LogFile parameter //寫入到指定文件
# console - standard output //寫入到標(biāo)準(zhǔn)輸出
# Mandatory: no
# Default:
# LogType=file

### Option: LogFile
# Log file name for LogType 'file' parameter.
//日志文件的存儲(chǔ)路徑
# Mandatory: no
# Default:
# LogFile=
LogFile=/var/log/zabbix/zabbix_server.log

### Option: LogFileSize
# Maximum size of log file in MB.
# 0 - disable automatic log rotation.
//指定日志文件的大小,單位MB。0表示禁用日志輪轉(zhuǎn)
# Mandatory: no
# Range: 0-1024
# Default:
# LogFileSize=1

### Option: DebugLevel
# Specifies debug level: //指定debug級(jí)別
# 0 - basic information about starting and stopping of Zabbix processes //關(guān)于進(jìn)程啟動(dòng)和停止的基本信息
# 1 - critical information //關(guān)鍵信息
# 2 - error information //錯(cuò)誤信息
# 3 - warnings //警告
# 4 - for debugging (produces lots of information) //調(diào)試信息
# 5 - extended debugging (produces even more information)?
# Mandatory: no
# Range: 0-5
# Default:
# DebugLevel=3

### Option: PidFile
# Name of PID file.
//pid文件名
# Mandatory: no
# Default:
# 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.
//數(shù)據(jù)庫(kù)主機(jī)名,如果設(shè)置為localhost,mysql必須用socket來連接,否則用ip來連接。若該參數(shù)為空,默認(rèn)連接PostgreSQL
# Mandatory: no
# Default:
# DBHost=localhost

### Option: DBName
# Database name.
# For SQLite3 path to database file must be provided. DBUser and DBPassword are ignored.
//數(shù)據(jù)庫(kù)名。對(duì)SQLite3來說,必須提供數(shù)據(jù)文件的路徑,DBUser和DBPassword參數(shù)可忽略
# Mandatory: yes
# Default:
# DBName=

### Option: DBSchema
# Schema name. Used for IBM DB2 and PostgreSQL.
//模式名。用于DB2或PostgreSQL數(shù)據(jù)庫(kù)
# Mandatory: no
# Default:
# DBSchema=

### Option: DBUser
# Database user. Ignored for SQLite.
//連接數(shù)據(jù)庫(kù)的用戶名,SQLite忽略該參數(shù)
# Mandatory: no
# Default:
# DBUser=

### Option: DBPassword
# Database password. Ignored for SQLite.
# Comment this line if no password is used.
//連接數(shù)據(jù)庫(kù)的密碼,SQLite忽略該參數(shù)
# Mandatory: no
# Default:
# DBPassword=

### Option: DBSocket
# Path to MySQL socket.
//socket文件的路徑
# Mandatory: no
# Default:
# DBSocket=/tmp/mysql.sock

### Option: DBPort
# Database port when not using local socket. Ignored for SQLite.
//數(shù)據(jù)庫(kù)監(jiān)聽端口,SQLite忽略該參數(shù)
# Mandatory: no
# Range: 1024-65535
# Default (for MySQL):
# DBPort=3306

############ ADVANCED PARAMETERS ################

### Option: StartPollers
# Number of pre-forked instances of pollers.
//系統(tǒng)初始化時(shí),預(yù)分配子進(jìn)程數(shù)量。數(shù)量越多,則服務(wù)端吞吐能力越強(qiáng),對(duì)系統(tǒng)資源消耗越大。
# Mandatory: no
# Range: 0-1000
# Default:
# StartPollers=5

### Option: StartIPMIPollers
# Number of pre-forked instances of IPMI pollers.
//系統(tǒng)初始化時(shí),預(yù)分配的使用ipmi協(xié)議獲取主機(jī)硬件狀態(tài)的進(jìn)程數(shù)量。
# Mandatory: no
# Range: 0-1000
# Default:
# 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.
//系統(tǒng)初始化時(shí),預(yù)分配用于探測(cè)某些不可達(dá)主機(jī)的(含IPMI、JAVA)的進(jìn)程數(shù)量;若使用場(chǎng)景中含有代理端,建議保持默認(rèn);若Agent較多,可視具體情況調(diào)整。
# Mandatory: no
# Range: 0-1000
# Default:
# StartPollersUnreachable=1

### 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.?
//系統(tǒng)初始化時(shí),預(yù)分配的用于接收zabbix sender提交來數(shù)據(jù)的進(jìn)程。
# Mandatory: no
# Range: 0-1000
# Default:
# StartTrappers=5

### Option: StartPingers
# Number of pre-forked instances of ICMP pingers.?
//系統(tǒng)初始化時(shí),預(yù)分配的icmp ping進(jìn)程的數(shù)量。若單臺(tái)代理所管理機(jī)器超過500臺(tái),建議加大此數(shù)值
# Mandatory: no
# Range: 0-1000
# Default:
# StartPingers=1

### Option: StartDiscoverers
# Number of pre-forked instances of discoverers.?
//系統(tǒng)初始化時(shí),預(yù)分配的自動(dòng)發(fā)現(xiàn)主機(jī)的線程數(shù)量。若單臺(tái)代理所管理機(jī)器超過500臺(tái),可以考慮加大此數(shù)值(僅適用于AGENT場(chǎng)景)
# Mandatory: no
# Range: 0-250
# Default:
# StartDiscoverers=1

### Option: StartHTTPPollers
# Number of pre-forked instances of HTTP pollers.?
//系統(tǒng)預(yù)分配的用于設(shè)置WEB監(jiān)控進(jìn)程數(shù),可視具體情況增加或減少此數(shù)值。
#
# Mandatory: no
# Range: 0-1000
# Default:
# 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.
//各實(shí)例計(jì)時(shí)器數(shù)量
# Mandatory: no
# Range: 1-1000
# Default:
# StartTimers=1

### Option: StartEscalators
# Number of pre-forked instances of escalators.
# Mandatory: no
# Range: 0-100
# Default:
# StartEscalators=1

### Option: StartVMwareCollectors
# Number of pre-forked vmware collector instances.?
//用于監(jiān)控VMWARE Esxi主機(jī)實(shí)例的進(jìn)程數(shù)量,為0則不啟用,若要監(jiān)控ESXI主機(jī),此值最少為1 ;視監(jiān)控ESXI數(shù)量設(shè)置對(duì)應(yīng)數(shù)值
# Mandatory: no
# Range: 0-250
# Default:
# StartVMwareCollectors=0

### Option: VMwareFrequency
# How often Zabbix will connect to VMware service to obtain a new data.?
//Zabbix連接WMware service獲取新數(shù)據(jù)的頻率
# Mandatory: no
# Range: 10-86400
# Default:
# 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
# Size of VMware cache, in bytes.?
# Shared memory size for storing VMware data.
# Only used if VMware collectors are started.
//用于緩存VMware數(shù)據(jù)的共享內(nèi)存
# Mandatory: no
# Range: 256K-2G
# Default:
# VMwareCacheSize=8M

### Option: VMwareTimeout
# Specifies how many seconds vmware collector waits for response from VMware service.
# Mandatory: no
# Range: 1-300
# Default:
# 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:
# SNMPTrapperFile=/tmp/zabbix_traps.tmp

### Option: StartSNMPTrapper
# If 1, SNMP trapper process is started.
//是否啟用snmptrapper功能 ,默認(rèn)不啟用=0,啟用=1
# 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
# ListenIP=127.0.0.1

### 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.?
//多少小時(shí)清理一次數(shù)據(jù)庫(kù)的 history, alert, and alarms數(shù)據(jù)
#
# Mandatory: no
# Range: 0-24
# Default:
# 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!
//housekeeping一次刪除的數(shù)據(jù)不能大于MaxHousekeeperDelete
#
# Mandatory: no
# Range: 0-1000000
# Default:
# MaxHousekeeperDelete=5000

### Option: SenderFrequency
# How often Zabbix will try to send unsent alerts (in seconds).
//指定間隔多少秒后,再嘗試發(fā)送為發(fā)送的報(bào)警
# 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.?
//分配多少共享內(nèi)存用于存儲(chǔ)配置信息,HOST,ITEM,TRIGGER數(shù)據(jù),視監(jiān)控主機(jī)數(shù)量和監(jiān)控項(xiàng)調(diào)整,建議調(diào)整到32M或者更大,2.2.3版本之前最大支持2G,3.X前最大支持8G,一般用不了多少。
# Mandatory: no
# Range: 128K-8G
# Default:
# CacheSize=8M

### Option: CacheUpdateFrequency
# How often Zabbix will perform update of configuration cache, in seconds.?
//更新系統(tǒng)CACHE頻率,若管理頁面操作不頻繁,可以考慮加大參數(shù)值
#
# Mandatory: no
# Range: 1-3600
# Default:
# CacheUpdateFrequency=60

### Option: StartDBSyncers
# Number of pre-forked instances of DB Syncers.?
//將采集數(shù)據(jù)從CACHE同步到數(shù)據(jù)庫(kù)線程數(shù)量,視數(shù)據(jù)庫(kù)服務(wù)器I/O繁忙情況,和數(shù)據(jù)庫(kù)寫能力調(diào)整。數(shù)值越大,寫能力越強(qiáng)。對(duì)數(shù)據(jù)庫(kù)服務(wù)器I/O壓力越大。
#
# Mandatory: no
# Range: 1-100
# Default:
# StartDBSyncers=4

### Option: HistoryCacheSize
# Size of history cache, in bytes.
# Shared memory size for storing history data.?
//設(shè)置劃分多少共享內(nèi)存用于存儲(chǔ)采集的歷史數(shù)據(jù),此數(shù)值越大,數(shù)據(jù)庫(kù)讀壓力越小
#
# Mandatory: no
# Range: 128K-2G
# Default:
# HistoryCacheSize=16M

### Option: HistoryIndexCacheSize
# Size of history index cache, in bytes.
# Shared memory size for indexing history cache.?
//歷史數(shù)據(jù)索引緩存
#
# Mandatory: no
# Range: 128K-2G
# Default:
# HistoryIndexCacheSize=4M

### Option: TrendCacheSize
# Size of trend cache, in bytes.
# Shared memory size for storing trends data.?
//用于設(shè)置劃分多少共享內(nèi)存用于存儲(chǔ)計(jì)算出來的趨勢(shì)數(shù)據(jù),此參數(shù)值從一定程度上可影響數(shù)據(jù)庫(kù)讀壓力
# Mandatory: no
# Range: 128K-2G
# Default:
# TrendCacheSize=4M

### Option: ValueCacheSize
# Size of history value cache, in bytes.
# Shared memory size for caching item history data requests.
# Setting to 0 disables value cache.
//0表示禁用,history value緩存大小,當(dāng)緩存超標(biāo)了,將會(huì)每隔5分鐘往server日志里面記錄。
# Mandatory: no
# Range: 0,128K-64G
# Default:
# ValueCacheSize=8M

### Option: Timeout
# Specifies how long we wait for agent, SNMP device or external check (in seconds).?
//與AGNET、SNMP設(shè)備和其它外部設(shè)備通信超時(shí)設(shè)置,單位為秒;若采集數(shù)據(jù)不完整或網(wǎng)絡(luò)繁忙,或從管理頁面發(fā)現(xiàn)客戶端狀態(tài)變化頻繁,可以考慮加大此數(shù)值。注意若此數(shù)值加大,應(yīng)該考慮參數(shù)StartPollers 是否有相應(yīng)加大的必要。
# Mandatory: no
# Range: 1-30
# Default:
# Timeout=3

### Option: TrapperTimeout
# Specifies how many seconds trapper may spend processing new data.?
//啟用trapper功能,用于進(jìn)程等待超時(shí)設(shè)置。
# Mandatory: no
# Range: 1-300
# Default:
# TrapperTimeout=300

### Option: UnreachablePeriod
# After how many seconds of unreachability treat a host as unavailable.
//當(dāng)Agent端處于不可用狀態(tài)下,間隔多少秒后,嘗試重新連接。建議根據(jù)具體情況設(shè)置。注意,若此數(shù)值過小,若Agent端業(yè)務(wù)系統(tǒng)繁忙時(shí),有可能造成報(bào)警誤報(bào)
# Mandatory: no
# Range: 1-3600
# Default:
# UnreachablePeriod=45

### Option: UnavailableDelay
# How often host is checked for availability during the unavailability period, in seconds.?
//當(dāng)Agent端處于不可用狀態(tài)下,間隔多少秒后,進(jìn)行狀態(tài)檢查。若出現(xiàn)可正常采集數(shù)據(jù),但管理頁面AGENT狀態(tài)不正常、或在網(wǎng)絡(luò),端口等均通暢情況下,AGENT狀態(tài)仍不正常,可以考慮加大此數(shù)值
# Mandatory: no
# Range: 1-3600
# Default:
# UnavailableDelay=60

### Option: UnreachableDelay
# How often host is checked for availability during the unreachability period, in seconds.
//當(dāng)Agent端處于不可達(dá)狀態(tài)下,延遲多少秒后,進(jìn)行重新嘗試,建議保持默認(rèn),在AGENT接入調(diào)試階段,可考慮減少此數(shù)值
# Mandatory: no
# Range: 1-3600
# Default:
# 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: 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.?
//用于服務(wù)端數(shù)據(jù)庫(kù)慢查詢功能,單位是毫秒。若有服務(wù)端數(shù)據(jù)庫(kù)監(jiān)控慢查詢的需求,可以視具體情況調(diào)整此數(shù)。
# Mandatory: no
# Range: 1-3600000
# Default:
# LogSlowQueries=0

### Option: TmpDir
# Temporary directory.
//指定臨時(shí)目錄路徑
# Mandatory: no
# Default:
# TmpDir=/tmp

### Option: StartProxyPollers
# Number of pre-forked instances of pollers for passive proxies.
//啟用多少子進(jìn)程與代理端通信,若代理端較多可考慮加大此數(shù)值
# 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.
//Zabbix服務(wù)端將配置文件數(shù)據(jù)同步到代理端的頻率,僅適用于代理端為被動(dòng)模式情況
# Mandatory: no
# Range: 1-3600*24*7
# Default:
# 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.
//Zabbix服務(wù)端請(qǐng)求代理端采集的數(shù)據(jù)的頻率,僅適用代理端為被動(dòng)模式情況
# Mandatory: no
# Range: 1-3600
# Default:
# 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
//是否允許以root身份運(yùn)行服務(wù)端
# Mandatory: no
# Default:
# AllowRoot=0

### Option: User
# Drop privileges to a specific, existing user on the system.
# Only has effect if run as 'root' and AllowRoot is disabled.
//啟動(dòng)zabbix server的用戶,在配置禁止root啟動(dòng),并且當(dāng)前shell用戶是root得情況下有效。如果當(dāng)前用戶是abc,那么zabbix server的運(yùn)行用戶是abc
# Mandatory: no
# Default:
# 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.
//某些情況下,軟件的參數(shù)配置文件很長(zhǎng),為了方便管理,將配置文件切割成N個(gè)配置文件,但為了主配置參數(shù)文件的簡(jiǎn)潔,便會(huì)啟用INCLUDE參數(shù),以方便程序讀取指定目錄下的所有配置文件
# Mandatory: no
# Default:
# Include=


向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI