zoukankan      html  css  js  c++  java
  • centos7以yum方式安装zabbix-agent客户端服务

    一、安装zabbix-agent3.2版本的yum源文件

    [root@localhost home]# rpm -ivh https://mirrors.aliyun.com/zabbix/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm

    二、修改zabbix的repo文件里的yum源地址为阿里云镜像地址

    [root@localhost home]# vim /etc/yum.repos.d/zabbix.repo 
    [zabbix]
    name=Zabbix Official Repository - $basearch
    baseurl=http://mirrors.aliyun.com/zabbix/zabbix/3.2/rhel/7/$basearch/
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
    
    [zabbix-non-supported]
    name=Zabbix Official Repository non-supported - $basearch
    baseurl=http://mirrors.aliyun.com/zabbix/non-supported/rhel/7/$basearch/
    enabled=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
    gpgcheck=1

    三、yum安装zabbix-agent

    [root@localhost home]# yum install zabbix-agent

    四、修改zabbix-agent的配置文件

    [root@localhost zabbix]# vim /etc/zabbix/zabbix_agentd.conf 
    Server=172.28.18.75
    ServerActive=172.28.18.75
    Hostname=172.28.5.124

    五、修改zabbix-agent服务配置为开机自启动

    [root@localhost zabbix]# systemctl list-unit-files|grep zabbix
    zabbix-agent.service                          disabled
    [root@localhost zabbix]# 

    当前默认是禁止自启动的,我们修改为开机自启动

    [root@localhost zabbix]# systemctl enable zabbix-agent.service
    Created symlink from /etc/systemd/system/multi-user.target.wants/zabbix-agent.service to /usr/lib/systemd/system/zabbix-agent.service.

    再次查看

    [root@localhost zabbix]# systemctl is-enabled zabbix-agent.service
    enabled

    六、启动zabbix-agent服务

    [root@localhost zabbix]# systemctl start zabbix-agent.service

    查看

    [root@localhost zabbix]# systemctl status zabbix-agent.service
    ● zabbix-agent.service - Zabbix Agent
       Loaded: loaded (/usr/lib/systemd/system/zabbix-agent.service; enabled; vendor preset: disabled)
       Active: active (running) since 五 2021-07-02 17:20:36 CST; 7s ago
      Process: 14798 ExecStart=/usr/sbin/zabbix_agentd -c $CONFFILE (code=exited, status=0/SUCCESS)
     Main PID: 14800 (zabbix_agentd)
       CGroup: /system.slice/zabbix-agent.service
               ├─14800 /usr/sbin/zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf
               ├─14801 /usr/sbin/zabbix_agentd: collector [idle 1 sec]
               ├─14802 /usr/sbin/zabbix_agentd: listener #1 [waiting for connection]
               ├─14803 /usr/sbin/zabbix_agentd: listener #2 [waiting for connection]
               ├─14804 /usr/sbin/zabbix_agentd: listener #3 [waiting for connection]
               └─14805 /usr/sbin/zabbix_agentd: active checks #1 [idle 1 sec]
    
    7月 02 17:20:36 localhost.localdomain systemd[1]: Starting Zabbix Agent...
    7月 02 17:20:36 localhost.localdomain systemd[1]: Started Zabbix Agent.
    [root@localhost zabbix]# 

    启动成功,在zabbix server上执行

    [root@zabbix_server home]# zabbix_get -s 172.28.5.124 -p 10050 -k 'system.uname'
    Linux localhost.localdomain 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64
    [root@zabbix_server home]# 

    成功获取服务器信息。

  • 相关阅读:
    小程序接入第三方ui库(组件库)
    element ui表格的校验和自定义校验规则
    element ui表格 表头的的特殊处理(换行/jsx风格表头)以及上传组件的一点小问题
    MongoDB 配置本地服务
    乙方渗透测试之Fuzz爆破
    SSRF漏洞挖掘经验
    SQL注入绕过技巧总结
    Xss Bypass备忘录
    bilibili存储型xss (绕过长度限制打乱顺序限制)
    XSS攻击常识及常见的XSS攻击脚本汇总
  • 原文地址:https://www.cnblogs.com/sky-cheng/p/14964210.html
Copyright © 2011-2022 走看看