zoukankan      html  css  js  c++  java
  • 【zabbix 监控】第二章 安装测试被监控主机

    客户端安装测试

    一、准备两台被监控主机,分别做如下操作:

    web129:192.168.19.129

    web130:192.168.19.130

    [root@web129 ~]#yum -y install zabbix-agent
    [root@web129 ~]# vim /etc/zabbix/zabbix_agentd.conf
    Server=192.168.19.128                被动模式 zabbix-server-ip
    ServerActive=192.168.19.128        主动模式  zabbix-server-ip
    Hostname=web129          
    [root@web129 ~]# systemctl start zabbix-agent
    [root@web129 ~]# systemctl enable zabbix-agent  
    [root@web129 ~]# 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))
    [root@web129 ~]#  firewall-cmd --permanent --add-port=10050/tcp
    [root@web129 ~]#  firewall-cmd --permanent --add-service=http
    [root@web129 ~]#  firewall-cmd --permanent --add-service=https
    [root@web129 ~]# firewall-cmd --reload 

    二、在服务端上进行测试

    server128:192.168.19.130

    [root@server128 ~]# 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
    [root@server128 ~]# 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
    [root@server128 ~]# zabbix_get -s 192.168.19.129 -k system.cpu.load[all,avg15]
    0.390000
    [root@server128 ~]# zabbix_get -s 192.168.19.130 -k system.cpu.load[all,avg15]
    0.050000
    [root@server128 ~]# zabbix_get -s 192.168.19.129 -k net.tcp.service[http]
    1
    [root@server128 ~]# zabbix_get -s 192.168.19.130 -k net.tcp.service[http]
    0
    web130上返回为0,可能原因web130上未安装http服务,或者没有关闭selinux,
    我的web130上是因为未安装http服务,安装后再次测试:
    [root@server128 ~]# zabbix_get -s 192.168.19.130 -k net.tcp.service[http] 1 [root@server128 ~]#
  • 相关阅读:
    垂直margin为什么会重叠
    forEach()和for/in循环的缺点与for-of循环
    使用CleanWebpackPlugin插件报错原因:CleanWebpackPlugin is not a constructor
    Vue中常用的组件库
    Vue中使用keep-alive优化网页性能
    Vue中router路由异步加载组件-优化性能
    面试题-JS中的作用域相关问题
    JS中的垃圾回收机制
    【转】 SpringMVC详解(三)------基于注解的入门实例
    【转】 SpringMVC详解(二)------详细架构
  • 原文地址:https://www.cnblogs.com/yangleitao/p/9480911.html
Copyright © 2011-2022 走看看