看了网上很多都说的不对,根本解决不了问题,其实是zabbix_agent 配置文件里 /etc/zabbix/zabbix_agentd.conf
修改前报错
[root@localhost zabbix]# zabbix_get -s 127.0.0.1 -p 10050 -k "system.cpu.load[all,avg1]"
zabbix_get [5864]: Check access restrictions in Zabbix agent configuration
vi
/etc/zabbix/zabbix_agentd.conf
# 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=10.10.11.10,127.0.0.1
修改后重启ok
[root@localhost zabbix]# systemctl restart zabbix-agent
[root@localhost zabbix]# zabbix_get -s 127.0.0.1 -p 10050 -k "system.cpu.load[all,avg1]"
0.110000
如果可以在zabbix server服务器上测试这个命令 被监控的主机可以不用添加本地ip 或者127.0.0.1
zabbix_get -s 10.10.10.10 -k mysql.status[Com_select]
zabbix_get -s 10.10.10.10 -k mysql.version
zabbix_get -s 10.10.10.10 -k mysql.ping
阅读(13471) | 评论(1) | 转发(0) |