Web登录zabbix总是弹出如下图的提示:
对服务的监控也没有影响,最后查了半天才知道问题的原因。
解决方法如下:
/data/www/wwwroot/zabbix/conf下有一个zabbix.conf.php(这是我的路径,你的不一定在这个位置哦)
修改zabbix.conf.php 配置文件中的$ZBX_SERVER字段为服务器的IP地址,默认是127.0.0.1
然后重启zabbix-server服务即可!
监控对象占满了trapper进程导致前端与server无法通信
“At least one trapper process must be running to display server availability and view queue in the frontend.”
——Trapper进程用于接收前端查询server可用性及队列的请求将StartTrappers=20调整到StartTrappers=100,
重启zabbix-server。
不知从什么时候开始,之前搭建的zabbix系统前端页面开始显示“zabbix server is not running: the information displayed may not be current”,反复确认过server正常运行、数据正常采集、告警正常发出,那么大概率是web端与server通信的问题,几个月以来,想起来这件事就搜索相关资料,试图找到原因,前前后后基本上把网上存在的所有方法都试了一遍,源码也研究了,依旧没有解决这个问题。
终于有一天突然想通了,回想起每次重启zabbix-server后,“zabbix server is not running: the information displayed may not be current”都会短暂消失,并且“系统信息”中“zabbix服务端运行中”为“yes”,并且系统刚搭建时完全正常没有这样的提示,那么很可能时zabbix server性能的问题,导致server端拒绝了web端的连接、查询状态请求。
于是我仔细阅读了/etc/zabbix_server.conf中的各个参数,终于找到了端倪:
### 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:
# StartTrappers=5
StartTrappers=100
“At least one trapper process must be running to display server availability and view queue in the frontend.”——Trapper进程用于接收前端查询server可用性及队列的请求,恐是因为监控对象占满了trapper进程导致前端与server无法通信,于是尝试调大该数值,将StartTrappers=20调整到StartTrappers=100,重启zabbix-server,观察了一段时间,“zabbix server is not running”的提示终于消失,“系统信息”及“队列”栏也显示正常。
这可能是一种解决方法。
zabbix-server不停重启,One child process died
查了好久也查不出所以然,看到数据库有45G,清理下,ok。zabbix-server服务起来了。
17513:20191224:092628.167 7f76bd8cd000-7f76bd8ce000 rw-p 00000000 00:00 0
17513:20191224:092628.167 7ffef170c000-7ffef172d000 rw-p 00000000 00:00 0 [stack]
17513:20191224:092628.167 7ffef17dc000-7ffef17de000 r-xp 00000000 00:00 0 [vdso]
17513:20191224:092628.167 ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
17513:20191224:092628.167 ================================
17513:20191224:092628.167 Please consider attaching a disassembly listing to your bug report.
17513:20191224:092628.167 This listing can be produced with, e.g., objdump -DSswx zabbix_server.
17513:20191224:092628.167 ================================
17503:20191224:092628.168 One child process died (PID:17513,exitcode/signal:1). Exiting ...
17503:20191224:092630.172 syncing history data...
17503:20191224:092630.279 syncing history data done
17503:20191224:092630.279 syncing trend data...
17503:20191224:092630.303 syncing trend data done
17503:20191224:092630.303 Zabbix Server stopped. Zabbix 3.4.15 (revision 86739).
过一会又出现zabbix-server自动重启。后来想到可能是我启用了系统自带的mail功能,网上有说过这个有bug。
https://blog.csdn.net/h106140873/article/details/104311586 之前是这里邮件配置错误。
于是关闭这个模块再truncate一下历史数据库,ok。
观察下zabbix-server的运行状态
watch -n 1 -d "systemctl status zabbix-server"
[root@gt-zabbix yum.repos.d]# systemctl status zabbix-server
● zabbix-server.service - Zabbix Server
Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; enabled; vendor preset: disabled)
Active: active (running) since Tue 2019-12-24 10:56:49 CST; 15min ago
Process: 34639 ExecStop=/bin/kill -SIGTERM $MAINPID (code=exited, status=1/FAILURE)
Process: 34842 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)
Main PID: 34844 (zabbix_server)
CGroup: /system.slice/zabbix-server.service
├─34844 /usr/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf
├─34878 /usr/sbin/zabbix_server: configuration syncer [synced configuration in 1.394036 sec, idle 60 sec]
├─34879 /usr/sbin/zabbix_server: alerter #1 [sent 0, failed 0 alerts, idle 667.706364 sec during 667.986064 sec]
├─34880 /usr/sbin/zabbix_server: alerter #2 [sent 0, failed 0 alerts, idle 677.474511 sec during 678.971590 sec]
├─34881 /usr/sbin/zabbix_server: alerter #3 [sent 0, failed 0 alerts, idle 672.695920 sec during 673.010181 sec]
├─34882 /usr/sbin/zabbix_server: housekeeper [startup idle for 30 minutes]
├─34883 /usr/sbin/zabbix_server: timer #1 [processed 106 triggers, 0 events in 0.002007 sec, 0 maintenances in 0.002024 sec, idle 30 sec]
├─34884 /usr/sbin/zabbix_server: http poller #1 [got 0 values in 0.000521 sec, idle 5 sec]
├─34885 /usr/sbin/zabbix_server: discoverer #1 [processed 0 rules in 0.000000 sec, performing discovery]
├─34886 /usr/sbin/zabbix_server: history syncer #1 [synced 0 items in 0.000048 sec, idle 1 sec]
├─34887 /usr/sbin/zabbix_server: history syncer #2 [synced 0 items in 0.000054 sec, idle 1 sec]
├─34888 /usr/sbin/zabbix_server: history syncer #3 [synced 0 items in 0.000065 sec, idle 1 sec]
├─34889 /usr/sbin/zabbix_server: history syncer #4 [synced 254 items in 0.015404 sec, idle 1 sec]
├─34890 /usr/sbin/zabbix_server: escalator #1 [processed 0 escalations in 0.000257 sec, idle 3 sec]
├─34891 /usr/sbin/zabbix_server: proxy poller #1 [exchanged data with 0 proxies in 0.000018 sec, idle 5 sec]
├─34892 /usr/sbin/zabbix_server: self-monitoring [processed data in 0.000016 sec, idle 1 sec]
├─34893 /usr/sbin/zabbix_server: task manager [processed 0 task(s) in 0.000110 sec, idle 5 sec]
├─34894 /usr/sbin/zabbix_server: poller #1 [got 167 values in 4.084475 sec, idle 1 sec]
├─34895 /usr/sbin/zabbix_server: poller #2 [got 59 values in 0.149098 sec, getting values]
├─34896 /usr/sbin/zabbix_server: poller #3 [got 0 values in 0.000028 sec, idle 1 sec]
├─34897 /usr/sbin/zabbix_server: poller #4 [got 45 values in 0.144095 sec, idle 1 sec]
├─34898 /usr/sbin/zabbix_server: poller #5 [got 42 values in 0.177383 sec, getting values]
├─34899 /usr/sbin/zabbix_server: unreachable poller #1 [got 2 values in 6.013010 sec, getting values]
├─34900 /usr/sbin/zabbix_server: trapper #1 [processed data in 0.000288 sec, waiting for connection]
├─34901 /usr/sbin/zabbix_server: trapper #2 [processed data in 0.000296 sec, waiting for connection]
├─34902 /usr/sbin/zabbix_server: trapper #3 [processed data in 0.000751 sec, waiting for connection]
├─34903 /usr/sbin/zabbix_server: trapper #4 [processed data in 0.000782 sec, waiting for connection]
├─34904 /usr/sbin/zabbix_server: trapper #5 [processed data in 0.001437 sec, waiting for connection]
├─34905 /usr/sbin/zabbix_server: icmp pinger #1 [pinging hosts]
├─34906 /usr/sbin/zabbix_server: alert manager #1 [sent 0, failed 0 alerts, idle 5.007279 sec during 5.007342 sec]
├─34907 /usr/sbin/zabbix_server: preprocessing manager #1 [queued 0, processed 967 values, idle 4.989516 sec during 5.000585 sec]
├─34908 /usr/sbin/zabbix_server: preprocessing worker #1 started
├─34909 /usr/sbin/zabbix_server: preprocessing worker #2 started
├─34910 /usr/sbin/zabbix_server: preprocessing worker #3 started
├─47412 sh -c /usr/sbin/fping -C3 2>&1 </tmp/zabbix_server_34885.pinger;/usr/sbin/fping6 -C3 2>&1 </tmp/zabbix_server_34885.pinger;
├─47413 /usr/sbin/fping -C3
├─47415 sh -c /usr/sbin/fping -C3 2>&1 </tmp/zabbix_server_34905.pinger;/usr/sbin/fping6 -C3 2>&1 </tmp/zabbix_server_34905.pinger;
└─47416 /usr/sbin/fping -C3
Dec 24 10:56:49 gt-zabbix.gtland.cn systemd[1]: Starting Zabbix Server...
Dec 24 10:56:49 gt-zabbix.gtland.cn systemd[1]: zabbix-server.service: Supervising process 34844 which is not our child. We'll most likely not notice when it exits.
Dec 24 10:56:49 gt-zabbix.gtland.cn systemd[1]: Started Zabbix Server.
Zabbix-zabbix-server启动失败,不停的重新启动以及one child process died等问题
背景:今天登录到zabbix web 发现最下边弹出提醒:zabbix server not running 但是web端还没有崩。立马去 systemctl status zabbix-server 发现 果然服务停了。于是 tail -f /var/log/zabbix/zabbix_server.log 发现它报如下图的错误,且一直再试图重启但失败。
于是在网上一顿找
(不精确的方法)
1)有人说是邮件报警问题,于是我在web端:管理—>报警媒介类型 里关闭了所有报警。
2)还有人说是setenfore 没有disable ,但是 我sestatus 查看 发现是 disable
3)还有的说是数据库满了
4)甚至有的说正在排查时,莫名奇妙消失了
结论:
关于One child process died 确实有很多种原因导致,但是具体原因日志已经明确告诉了我们,只是我们看错了位置,具体原因就在日志上面。one child process died只是真实原因导致的结果而已。
1、如下图,我这里的原因是out of memory*而且还好告诉了要修改zabbix server.conf中的CacheSize参数即可。
将CacheSize改大点就好了
zabbix-server就启动成功了
2、若这里报错Permission denied则是selinux的原因
这就是 selinux 没有disable造成的
可以 直接 #setenforce 0 暂时关闭,也可以vim /etc/selinux/config
SELINUX=disabled
[Z3001]connection to database 'zabbix' failed: [1040] Too many connections 问题及处理
Zabbix监控系统连接的MySQL数据库,无法启动zabbix-server,查看日志发现有如下信息
[Z3001] connection to database 'zabbix' failed: [1040] Too many connections
数据库连接过多,数据库自动退出。
由于MySQL数据库默认连接数较少,所以需要增加默认连接数
进入数据库后:
show variables like 'max_connections';(查可以看当前的最大连接数)
set global max_connections=1000;(设置最大连接数为1000,可以再次查看是否设置成功)
exit(退出)
如果不够,修改my.ini文件
增加或修改 max_connections=(根据需要填写连接数)
保存退出后,重启mysql的服务
重启Zabbix-server,系统启动正常。
以上汇总的操作,基本可以解决这个问题。
推荐本站淘宝优惠价购买喜欢的宝贝:
本文链接:https://hqyman.cn/post/2472.html 非本站原创文章欢迎转载,原创文章需保留本站地址!
休息一下~~