zabbix-agent客户端安装与配置

zabbix-agent客户端安装与配置

  1. 下载abbix-agent客户端源码软件包

  2. 解压agent源码包,并且切换到解压目录。

    [root@localhost ~]# tar -zxf zabbix-3.4.8.tar.gz
    [root@localhost ~]# cd zabbix-3.4.8/
    [root@localhost zabbix-3.4.8]# pwd
    /root/zabbix-3.4.8
    
  3. 编译安装

    ./configure --prefix=/usr/local/zabbix --enable-agent
    make && make install
    
  4. 切换/usr/local/zabbix/etc/下修改zabbix_agentd.conf文件。主要修改一下参数:

    a.用vim直接去修改方法如下
     
       LogFile=/tmp/zabbix_agentd.log       #zabbinx_agent客户端日志
       Server=19.168.100.14                 #服务器端的IP地址
       ServerActive=192.168.100.14          #服务器端的IP地址
       Hostname=192.168.100.15              #客户端IP地址
     
    b. 用cat把配置文件参数直接写入zabbix_agentd.conf
     
      cat >/usr/local/zabbix/etc/zabbix_agentd.conf<<EOF
       LogFile=/tmp/zabbix_agentd.log    
       Server=19.168.100.14            
       ServerActive=192.168.100.14      
       Hostname=192.168.100.15
       EOF
    
  5. 切换到zabbix解压目录,拷贝zabbix_agentd启动脚本到/etc/init.d/目录。

    [root@localhost ~]# cd zabbix-3.4.8/
    [root@localhost zabbix-3.4.8]# pwd
    /root/zabbix-3.4.8
    [root@localhost zabbix-3.4.8]# cp misc/init.d/tru64/zabbix_agentd /etc/init.d/zabbix_agentd
    
  6. 设置/etc/init.d/zabbix_agentd执行权限

    [root@localhost zabbix-3.4.8]# chmod o+x /etc/init.d/zabbix_agentd
    
  7. 启动zabbix_agentd服务

    /etc/init.d/zabbix_agentd start        #开启服务
    /etc/init.d/zabbix_agentd stop         #关闭服务
    /etc/init.d/zabbix_agentd restart      #重起服务
    
posted @ 2019-10-24 01:53  骑马挎枪打天下  阅读(1137)  评论(0编辑  收藏  举报