前言

根据安装和使用 Zabbix 中遇到的常见报错提示,结合 Zabbix 官网和 Google 到的一些解决方案,简单做下分享

Zabbix 常见问题整理

更新历史

2019 年 07 月 11 日 - 增加[Z3005] query failed: [1062] Duplicate entry 错误解决方案
2019 年 03 月 05 日 - 完善内容
2018 年 11 月 02 日 - 初稿

阅读原文 - https://liaojiaxin158.github.io/post/zabbix-faq/

扩展阅读

Zabbix - https://www.zabbix.com/


官方文档

Frequently asked questions / Troubleshooting

https://www.zabbix.org/wiki/Troubleshooting
https://www.zabbix.com/documentation/current/manual/appendix/faq

FAQ

常见错误建议先查看 log,常见的问题通常由权限,防火墙,数据库,参数错误,性能瓶颈等问题导致

zabbix_get [7189]: Check access restrictions in Zabbix agent configuration
zabbix 的服务器端与客户端连接的主要工具就是 zabbix 里 bin 文件夹下的 zabbix_get 文件,这个命令只能在 zabbix 的 server 端使用

Assuming that agent dropped connection because of access permissions(由于访问权限导致 agent 连接失败)
问题实现:zabbix_server 和 zabbix_agent 在同一台机器,server 监听全网地址,agent 监听内网地址。导致上面的报错发生
解决方案:把 zabbix_agentd.conf 中 的 server 把 zabbix_server 的公网和内网地址都加行。然后 agent 就可以正常获取到值了

1
2
3
4
zabbix_get -s 127.0.0.1 -p 10050 -k system.hostname
Check access restrictions in Zabbix agent configuration
# 如果 zabbix-agent 报以下错误需要检查 agent 和 server 的版本是否匹配
Message from xx.xx.xx.xx is missing header. Message ignored.

解决 zabbix 中文乱码问题

方法一:下载文泉驿字体
yum -y install wqy-microhei-fonts
cp /usr/share/fonts/wqy-microhei/wqy-microhei.ttc /usr/share/fonts/dejavu/DejaVuSans.ttf

方法二:从 Windows 中拷贝
cd /usr/share/zabbix/fonts
从 windows 拷贝 simhei.ttf 字体到当前目录
替换配置文件
vim /usr/share/zabbix/include/defines.inc.php
define(‘ZBX_GRAPH_FONT_NAME’, ‘simhei’)

Zabbix 报 No route to host
原来是被客户端的防火墙档掉了,关闭客户端防火墙或者配置相应规则即可

No active checks on server: host [] not found
查看监控机上的 / tmp/zabbix_server.log,显示日志:
cannot send list of active checks to [192.168.0.1]: host [Zabbix server] not found
查看被监控机上的 / tmp/zabbix_agentd.log,显示日志:
No active checks on server: host [Zabbix server] not found
这是因为通过 zabbix dashboard 页面配置的被监控主机名跟被监控主机上 zabbix_agentd.conf 中配置的 Hostname 不一致。修改为一致的名字后,重启 zabbix_agentd 即可。

Zabbix alerter processes more than 75% busy
zabbix 服务器邮件进程繁忙导致的,一般是因为在设置动作的时候,间隔太短,在一些特殊情况下,产生大量告警,例如几万封邮件,服务器发邮件,邮件进程发挂了。
建议通过导流解决。改发邮件的脚本,将邮件的动作改为打印时间,如下,待邮件都释放完了,再改回来。

Zabbix discoverer processes more than 75% busy
配置了自动发现的任务。每个自动发现的任务都会在一定时间内占用一个自动发现的进程。而默认配置项为 1,所以报警
修改配置文件的 StartDiscoverers 选项
StartDiscoverers=10

Zabbix poller processes more than 75% busy
轮询的负载量高,网上大多数说法是增加启动的 StartPollers 进程数,个人建议分析自己的 items 监控项设置是否合理,templates 模板应用是否恰当。
调整 StartPollers 数量
StartPollers=500
StartPollersUnreachable=100

Zabbix housekeeper processes more than 75% busy
为了防止数据库持续增大,zabbix 有个自动删除历史数据的机制,就是 housekeeper,而 mysql 数据库删数据的时候,性能会降低,就会报这个错。建议禁用采取数据库分区表优化自动清理。
HousekeepingFrequency=0 #间隔时间

2816:20170725:174352.675 [file:dbconfig.c,line:652] zbx_mem_realloc(): out of memory (requested 162664 bytes)
2816:20170725:174352.675 [file:dbconfig.c,line:652] zbx_mem_realloc(): please increase CacheSize configuration parameter
提示内存溢出,需要调整 zabbix 服务器配置 zabbix_server.conf
CacheSize=8G

PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 11 bytes)
zabbix 某些页面无法打开,查看 php 日志发现,当访问这个页面是,报错内存不足,不清楚是否内存泄露,最简单的方法是调大 php 进程的可用内存,memory_limit 默认值为 128M
grep ‘memory_limit’ /etc/httpd/conf.d/zabbix.conf
php_value memory_limit 512M

Too many processes on zabbix server
zabbix 服务器进程太多报警,默认超过 300 个进程就报警。感觉默认值太小了,zabbix 配置调优后,进程就 500 多个了,所以我把触发值改为 600.

Zabbix value cache working in low memory mode
zabbix 历史记录 cache 大小默认值较低,如果出现这个报错调高 ValueCacheSize 即可

查看日志发现 zabbix-server 取到了数据插入数据库的 event_recovery 表时失败。

1
2
3
4
5
6
[root@zabbix]# tailf zabbix_server.log
8807:20190711:192713.951 [Z3005] query failed: [1062] Duplicate entry '153816' for key 'PRIMARY' [insert into event_recovery (eventid,r_eventid,correlationid,c_eventid,userid) values (153816,16845596,null,null,null);
]
8809:20190711:192713.966 [Z3005] query failed: [1062] Duplicate entry '150935' for key 'PRIMARY' [insert into event_recovery (eventid,r_eventid,correlationid,c_eventid,userid) values (150935,16845597,null,null,null),(150880,16845598,null,null,null);
]
8809:20190711:192716.050 [Z3005] query failed: [1062] Duplicate entry '153757' for key 'PRIMARY' [insert into event_recovery (eventid,r_eventid,correlationid,c_eventid,userid) values (153757,16845599,null,null,null),(153758,16845600,null,null,null),(153713,16845601,null,null,null);

经查看表结构确定了该表只是记录了事件恢复的全部数据信息,与 user、correlation、events 表相关联。
所以备份 event_recovery 表并 truncate 删除重建 event_recovery

1
2
3
4
5
root@zabbix:~# mysqldump -zabbix -p'zabbix' zabbix event_recovery > event_recovery.sql
root@zabbix:~# mysql -uzabbix -p'zabbix'
mysql> use zabbix
mysql> truncate table event_recovery;
mysql> optimize table event_recovery;

zabbix_server.conf 中英文解释

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
# 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 size of log file in MB.
# 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
# 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=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:
# [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:
# 说明: 每个 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
# Size of configuration cache, in bytes.
# Shared memory size for storing host, item and trigger data.
#
# 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
# Size of history cache, in bytes.
# Shared memory size for storing history data.
#
# Mandatory: no
# Range: 128K-2G
# Default:
# 说明:用于设置划分多少系统共享内存用于存储采集的历史数据,此数值越大,数据库读压力越小
HistoryCacheSize=2048M
### Option: HistoryIndexCacheSize
# Size of history index cache, in bytes.
# Shared memory size for indexing history cache.
#
# Mandatory: no
# Range: 128K-2G
# Default:
# 说明:3.0.0 开始支持,历史索引大小,一个监控项需要 100bytes 来存储
HistoryIndexCacheSize=2048M
### Option: TrendCacheSize
# Size of trend cache, in bytes.
# Shared memory size for storing trends data.
#
# Mandatory: no
# Range: 128K-2G
# Default:
# 说明:用于设置划分多少系统共享内存用于存储计算出来的趋势数据,此参数值从一定程度上可影响数据库读压力
TrendCacheSize=512M
### 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=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=<module.so>
# 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. 1. 前言
  2. 2. 更新历史
  3. 3. 官方文档
  4. 4. FAQ
  5. 5. zabbix_server.conf 中英文解释