host exec zabbix_get must list in Server=IP List config zabbix_agentd.conf

简介:
在使用zabbix_get测试时, 发现即使配置了Server列表还是不能正常返回要的结果, 原因是配置格式的问题,
不能在IP外使用单引号.
例如 : 
 
  

zabbix_agentd.conf
### Option: Server
#       List of comma delimited IP addresses (or hostnames) of Zabbix servers.
#       Incoming connections will be accepted only from the hosts listed here.
#       If IPv6 support is enabled then '127.0.0.1', '::127.0.0.1', '::ffff:127.0.0.1' are treated equally.
#
# Mandatory: no
# Default:
# Server=

Server=172.16.3.150, 127.0.0.1
不要使用以下带单引号的格式, 会导致无效, 除非你启用了ipv6.
Server='172.16.3.150', '127.0.0.1'


只有配置在Server列表中的server, zabbix agentd才响应数据请求.
没有配置的话, 可以从zabbix agentd日志中看到类似错误 : 
 

 21034:20141107:090930.460 Listener error: connection from "127.0.0.1" rejected, allowed hosts: "'172.16.3.150','127.0.0.1'"

这个错误就是配置格式引起的.
把单引号去掉即可 : 
正常响应如下 : 
 
 

[root@150 etc]# zabbix_get -s 127.0.0.1 -p 10050 -I 127.0.0.1 -k "hello"
ZBX_NOTSUPPORTED
[root@150 etc]# zabbix_get -s 127.0.0.1 -p 10050 -I 127.0.0.1 -k "psql"
ZBX_NOTSUPPORTED

没响应就是返回空 : 
 
 

[root@150 etc]# zabbix_get -s 127.0.0.1 -p 10050 -I 127.0.0.1 -k "psql"

并且报错如 : 
 
 

 21034:20141107:090930.460 Listener error: connection from "127.0.0.1" rejected, allowed hosts: "'172.16.3.150','127.0.0.1'"

相关文章
|
10月前
|
监控 安全 Shell
Zabbix Server trapper 命令注入漏洞 (CVE-2017-2824)
Zabbix Server trapper 命令注入漏洞,攻击者可通过特定Payload获取服务器执行权限。
162 1
|
9月前
|
NoSQL Java Redis
redis.clients.jedis.exceptions.JedisDataException: ERR Syntax error, try CLIENT (LIST | KILL ip:port
redis.clients.jedis.exceptions.JedisDataException: ERR Syntax error, try CLIENT (LIST | KILL ip:port
|
2月前
|
Java API Nacos
spring.config.import 是一个 Spring Cloud Config Server 的属性,
spring.config.import 是一个 Spring Cloud Config Server 的属性,【1月更文挑战第25天】【1月更文挑战第123篇】
182 1
|
2月前
|
监控 数据库连接 数据安全/隐私保护
安装Zabbix Server
安装Zabbix Server
70 1
|
存储 负载均衡 前端开发
Spring Cloud【Finchley】实战-05配置中心的搭建(配合使用Eureka)和Config Server高可用
Spring Cloud【Finchley】实战-05配置中心的搭建(配合使用Eureka)和Config Server高可用
184 0
|
存储 Java 开发工具
SpringCloud--Config Server配置中心学习总结
使用分布式微服务开发和部署项目,其中的一个优势就是:使用分布式配置协调服务,达到统一配置存储和使用。
169 0
SpringCloud--Config Server配置中心学习总结
|
API Windows 容器
MFC应用程序——标签控件_IP控件_时间控件_List Control控件_Tree Control控件_命令按钮_列表框_组合框_图片_滚动控件(上)
MFC应用程序——标签控件_IP控件_时间控件_List Control控件_Tree Control控件_命令按钮_列表框_组合框_图片_滚动控件
176 0
MFC应用程序——标签控件_IP控件_时间控件_List Control控件_Tree Control控件_命令按钮_列表框_组合框_图片_滚动控件(上)
|
监控 虚拟化 Windows
Zabbix对Windows Server的监控
Zabbix对Windows Server的监控
Zabbix对Windows Server的监控
|
jenkins Java 应用服务中间件
Jenkins部署异常: java.io.FileNotFoundException: http://ip:端口/manager/text/list
Jenkins部署异常: java.io.FileNotFoundException: http://ip:端口/manager/text/list
417 0
Jenkins部署异常: java.io.FileNotFoundException: http://ip:端口/manager/text/list
MFC应用程序——标签控件_IP控件_时间控件_List Control控件_Tree Control控件_命令按钮_列表框_组合框_图片_滚动控件(下)
MFC应用程序——标签控件_IP控件_时间控件_List Control控件_Tree Control控件_命令按钮_列表框_组合框_图片_滚动控件
146 0

推荐镜像

更多