升级zabbix的时候,在使用zabbix_get进行测试的时候,出现以下报错:

# zabbix_get -s 192.168.56.162 -k "system.cpu.load[all,avg15]"
zabbix_get [174275]: Check access restrictions in Zabbix agent configuration

zabbix_agent日志输出如下:

194528:20220415:105856.095 Message from 192.168.56.162 is missing header. Message ignored.

在确保了zabbix_agent.conf中的配置准确无误,并且网络、防火墙等都没有任何问题的情况下,陷入了僵局。

最终发现zabbix_server和zabbix_agent的版本不同,如下所示:

 zabbix_get版本

# zabbix_get -V
zabbix_get (Zabbix) 3.4.15
Revision 86739 12 November 2018, compilation time: Nov 12 2018 05:54:29

Copyright (C) 2018 Zabbix SIA
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it according to
the license. There is NO WARRANTY, to the extent permitted by law.

This product includes software developed by the OpenSSL Project
for use in the OpenSSL Toolkit (http://www.openssl.org/).

Compiled with OpenSSL 1.0.1e-fips 11 Feb 2013
Running with OpenSSL 1.0.1e-fips 11 Feb 2013

zabbix_server版本

# zabbix_server -V
zabbix_server (Zabbix) 5.0.22
Revision 90ee9e33d3 4 April 2022, compilation time: Apr 4 2022 12:19:14

Copyright (C) 2022 Zabbix SIA
License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it according to
the license. There is NO WARRANTY, to the extent permitted by law.

This product includes software developed by the OpenSSL Project
for use in the OpenSSL Toolkit (http://www.openssl.org/).

Compiled with OpenSSL 1.0.1e-fips 11 Feb 2013
Running with OpenSSL 1.0.1e-fips 11 Feb 2013

直接安装升级zabbix_get为5.0.22,测试后问题解决

# zabbix_get -s 192.168.56.162 -k "system.cpu.load[all,avg15]"
18.170000