【zabbix监控问题】记录zabbix控制面板报错及日志报错的解决方法

问题1:

上图是我已经解决了的截图。在百度查询的资料中,说是把zabbix_agentd.conf文件中server监听的主机127.0.0.1去掉,但是我去掉之后问题仍然没有解决,最后在这篇博客上发现:是我防火墙启动了的原因,至于防火墙启动大概是我安装bt的时候脚本中启动了,将防火墙stop之后,问题解决。

查看agentd日志:

[root@VM_0_10_centos src]# tail -f /tmp/zabbix_agentd.log 
 32170:20191204:164250.030 **************************
 32170:20191204:164250.030 using configuration file: /usr/local/etc/zabbix_agentd.conf
 32170:20191204:164250.030 agent #0 started [main process]
 32171:20191204:164250.031 agent #1 started [collector]
 32172:20191204:164250.031 agent #2 started [listener #1]
 32173:20191204:164250.032 agent #3 started [listener #2]
 32174:20191204:164250.032 agent #4 started [listener #3]
 32175:20191204:164250.032 agent #5 started [active checks #1]
 32176:20191204:164250.032 agent #6 started [active checks #2]
 32176:20191204:164250.035 active check configuration update from [106.53.73.200:10051] started to fail (cannot connect to [
 [106.53.73.200]:10051]: [113] No route to host) # 出现报错
32176:20191204:164950.123 active check configuration update from [106.53.73.200:10051] is working again # 解决之后输出的信息

问题2:Lack of free swap space on tanbaobao

原因:

  部分云主机没有设置交换分区/虚拟内存,使用free -m命令将会显示 SWAP 三项都为0
free -m 显示系统无交换空间

解决:

  配置==》模板==》选择Template OS Linux==》触发器

 打开Lack of free swap space on {HOST.NAME}项目,在新打开的触发器编辑页面中修改Expression(表达式)的内容,将原来的

{Template OS Linux:system.swap.size[,pfree].last(0)}<50

改为:

{Template OS Linux:system.swap.size[,pfree].last(0)}<50 and {Template OS Linux:system.swap.size[,free].last(0)}<>0

  此处修改增加了“ and {Template OS Linux:system.swap.size[,free].last(0)}<>0”判断系统有交换空间,当系统无交换空间
即{Template OS Linux:system.swap.size[,free].last(0)}的值为0时将不会时表达式不成立就不会触发错误提示。
  保存之后在下一个更新周期内Zabbix之前报告的“Lack of free swap space”问题就会被自动标记为Resolved(已解决)

问题3:日志报错cannot send list of active checks to "主机ip": host [主机名] not found

  在确保防火墙,selinux设置好之后,网络、端口也是通的情况下,一般是主机解析问题,在zabbix_server服务端和zabbix_agentd被监控端添加主机解析,之后查看日志应该是正常的,我这里后面虽然没有设置,自己也自动恢复了,不过保险起见,设置一下比较好

# 监控端(服务端)
[root@tanbaobao ~]# vi /etc/hosts
10.0.0.1 主机名.localdomain 主机名
10.0.0.2 主机名

# 被监控端
[root@VM_0_16_centos ~]# vi /etc/hosts
10.0.0.2 主机名.localdomain 主机名
10.0.0.1 主机名

问题4:Zabbix对tomcat监控总是出现预警:gzip compression is off for connector http-8080 on XXXXXX

问题解决:

# 编辑tomcat的server.xml文件
# 从上面节点的属性可以看出,要使用gzip压缩功能,你需要在Connector节点中加上如下属性
# compression=“on” 打开压缩功能
# compressionMinSize=“50” 启用压缩的输出内容大小,默认为2KB
# noCompressionUserAgents=“gozilla, traviata” 对于以下的浏览器,不启用压缩
# compressableMimeType=“text/html,text/xml,text/javascript,text/css,text/plain” 哪些资源类型需要压缩
[root@VM_0_10_centos ~]# vi /usr/local/tomcat9.0.29/conf/server.xml 
 <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" 
                compression="on"
                compressionMinSize="50" 
                noCompressionUserAgents="gozilla, traviata" 
                compressableMimeType="text/html,text/xml,text/javascript,text/css,text/plain" />

# 重启服务
[root@VM_0_10_centos ~]# /usr/local/tomcat9.0.29/bin/shutdown.sh 
[root@VM_0_10_centos ~]# /usr/local/tomcat9.0.29/bin/startup.sh 

问题解决:

待更新中......

参考博客:

https://blog.csdn.net/qq_37961660/article/details/79923963

https://blog.csdn.net/weixin_42867972/article/details/88581342

原文地址:https://www.cnblogs.com/HeiDi-BoKe/p/11983975.html