zabbix 监控第二章 安装测试被监控主机
Posted yangleitao
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了zabbix 监控第二章 安装测试被监控主机相关的知识,希望对你有一定的参考价值。
客户端安装测试
一、准备两台被监控主机,分别做如下操作:
web129:192.168.19.129
web130:192.168.19.130
[[email protected] ~]#yum -y install zabbix-agent [[email protected] ~]# vim /etc/zabbix/zabbix_agentd.conf Server=192.168.19.128 被动模式 zabbix-server-ip ServerActive=192.168.19.128 主动模式 zabbix-server-ip Hostname=web129 [[email protected] ~]# systemctl start zabbix-agent [[email protected] ~]# systemctl enable zabbix-agent [[email protected] ~]# ss -anlp |grep :10050 tcp LISTEN 0 128 *:10050 *:* users:(("zabbix_agentd",pid=8430,fd=4),("zabbix_agentd",pid=8429,fd=4),("zabbix_agentd",pid=8428,fd=4),("zabbix_agentd",pid=8427,fd=4),("zabbix_agentd",pid=8426,fd=4),("zabbix_agentd",pid=8425,fd=4)) tcp LISTEN 0 128 :::10050 :::* users:(("zabbix_agentd",pid=8430,fd=5),("zabbix_agentd",pid=8429,fd=5),("zabbix_agentd",pid=8428,fd=5),("zabbix_agentd",pid=8427,fd=5),("zabbix_agentd",pid=8426,fd=5),("zabbix_agentd",pid=8425,fd=5)) [[email protected] ~]# firewall-cmd --permanent --add-port=10050/tcp [[email protected] ~]# firewall-cmd --permanent --add-service=http [[email protected] ~]# firewall-cmd --permanent --add-service=https [[email protected] ~]# firewall-cmd --reload
二、在服务端上进行测试
server128:192.168.19.130
[[email protected] ~]# zabbix_get -s 192.168.19.130 -k system.uname Linux web130 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 [[email protected] ~]# zabbix_get -s 192.168.19.129 -k system.uname Linux web129 3.10.0-514.el7.x86_64 #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 [[email protected] ~]# zabbix_get -s 192.168.19.129 -k system.cpu.load[all,avg15] 0.390000 [[email protected] ~]# zabbix_get -s 192.168.19.130 -k system.cpu.load[all,avg15] 0.050000 [[email protected] ~]# zabbix_get -s 192.168.19.129 -k net.tcp.service[http] 1 [[email protected] ~]# zabbix_get -s 192.168.19.130 -k net.tcp.service[http] 0
web130上返回为0,可能原因web130上未安装http服务,或者没有关闭selinux,
我的web130上是因为未安装http服务,安装后再次测试:
[[email protected] ~]# zabbix_get -s 192.168.19.130 -k net.tcp.service[http] 1 [[email protected] ~]#
以上是关于zabbix 监控第二章 安装测试被监控主机的主要内容,如果未能解决你的问题,请参考以下文章