[root@zabbix_agent src]# cd zabbix-3.0.3
[root@zabbix_agent zabbix-3.0.3]# ls
aclocal.m4 bin ChangeLog conf config.sub configure.ac database frontends INSTALL m4 Makefile.in misc NEWS src
AUTHORS build compile config.guess configure COPYING depcomp include install-sh Makefile.am man missing README upgrades
[root@zabbix_agent zabbix-3.0.3]# ./configure --prefix=/usr/local/zabbix-3.0.3/ --enable-agent
[root@zabbix_agent zabbix-3.0.3]# yum install -y gcc c++
[root@zabbix_agent zabbix-3.0.3]# ./configure --prefix=/usr/local/zabbix-3.0.3/ --enable-agent
[root@zabbix_agent zabbix-3.0.3]# make install
# vim /usr/local/zabbix-3.0.3/etc/zabbix_agentd.conf
Server=ip(zabbix_server的ip)
ServerActive==ip(zabbix_server的ip)
Hostname=Zabbix server
其中Server和ServerActive都指定zabbixserver的IP地址,不同的是,前者是被动后者是主动。也就是说Server这个配置是用来允许127.0.0.1这个ip来我这取数据。而serverActive的127.0.0.1的意思是,客户端主动提交数据给他.
主机安装客户端记得添加zabbix用户
[root@zabbix_agent zabbix-3.0.3]# userdel zabbix
[root@zabbix_agent zabbix-3.0.3]# groupadd zabbix
[root@zabbix_agent zabbix-3.0.3]# useradd -g zabbix zabbix

启动zabbix客户端:

[root@zabbix_agent zabbix-3.0.3]# /usr/local/zabbix-3.0.3/sbin/zabbix_agentd
[root@zabbix_agent zabbix-3.0.3]# netstat -lnutp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 8899/zabbix_agentd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2097/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1493/master
tcp 0 0 :::22 :::* LISTEN 2097/sshd
tcp 0 0 ::1:25 :::* LISTEN 1493/master
udp 0 0 0.0.0.0:68 0.0.0.0:* 1247/dhclient
[root@zabbix_agent zabbix-3.0.3]# ln -s /usr/local/zabbix-3.0.3/sbin/* /usr/local/sbin/
[root@zabbix_agent zabbix-3.0.3]# ln -s /usr/local/zabbix-3.0.3/bin/* /usr/local/bin/
[root@zabbix_agent zabbix-3.0.3]# vi /etc/services #添加以下内容
zabbix-agent 10050/tcp # Zabbix Agent
zabbix-agent 10050/udp # Zabbix Agent
zabbix-trapper 10051/tcp # Zabbix Trapper
zabbix-trapper 10051/udp # Zabbix Trapper

修改Zabbix配置文件

[root@zabbix_agent zabbix-3.0.3]# vi /usr/local/zabbix-3.0.3/etc/zabbix_agentd.conf
Server=192.168.1.122
Include=/usr/local/zabbix-3.0.3/etc/zabbix_agentd.conf.d/
UnsafeUserParameters=1 #启用自定义key

添加开机启动脚本

[root@zabbix_agent ~]# cp /usr/local/src/zabbix-3.0.3/misc/init.d/fedora/core/zabbix_agentd /etc/rc.d/init.d/zabbix_agentd
[root@zabbix_agent ~]# vi /etc/rc.d/init.d/zabbix_agentd

        # Zabbix-Directory
BASEDIR=/usr/local/zabbix-3.0.3/ #Zabbix安装目录
[root@zabbix_agent ~]# chmod +x /etc/rc.d/init.d/zabbix_agentd
[root@zabbix_agent ~]# chkconfig zabbix_agentd on
[root@zabbix_agent ~]# service zabbix_agentd start
/etc/init.d/zabbix_agentd : zabbix_agentd (pid 8899) already running
[root@zabbix_agent ~]# netstat -lnutp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 8899/zabbix_agentd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2097/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1493/master
tcp 0 0 :::22 :::* LISTEN 2097/sshd
tcp 0 0 ::1:25 :::* LISTEN 1493/master
udp 0 0 0.0.0.0:68 0.0.0.0:* 1247/dhclient

测试Zabbix客户端与Zabbix服务端通信是否正常

[root@zabbix_agent ~]# /usr/local/zabbix-3.0.3/bin/zabbix_get -s 192.168.1.119 -p10050 -k "system.uptime"
zabbix_get [9070]: Check access restrictions in Zabbix agent configuration

备注:192.168.1.119是Zabbix客户端IP地址

zabbix 二 zabbix agent 客户端的更多相关文章

  1. Zabbix(二) : Zabbix Server端配置文件说明

    Zabbix Server端配置文件说明 # This is a configuration file for Zabbix Server process # To get more informat ...

  2. zabbix学习-如何部署一个agent客户端

    1. 部署一个agent客户端很简单,比如监控服务器本身 yum install zabbix-agent -y 2.配置文件位置: vim /etc/zabbix/zabbix-agendt.con ...

  3. Centos下zabbix部署(二)agent安装并设置监控

    1.配置zabbix源 rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch ...

  4. Centos 6.x 搭建 Zabbix Agent 客户端

    如需搭建zabbix server端,请参考:Zabbix-Server配置 环境: Zabbix-Server: Centos 6.8   IP:192.168.126.129    #Zabix- ...

  5. zabbix安装配置agent程序之agent配置文件详解

    安装zabbix-agent http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/ 下载:zabbix-agent-3.2.0-1.el6.x86_64.r ...

  6. Zabbix二次开发_01基础

    最近有个想法:想做一个zabbix数据的二次呈现,所以来写一下Zabbix的api的内容. 先说下zabbix api的认证基础. Zabbix API简介 Zabbix API开始扮演着越来越重要的 ...

  7. Zabbix二次开发_02获取数据

    最近准备写一个zabbix二次页面的呈现.打算调用zabbix api接口来进行展示. 具体流程以及获取的数据. 1.  获得认证密钥    2.  获取zabbix所有的主机组    3.  获取单 ...

  8. Zabbix监控 windows agent安装配置

    下载Windows的zabbix客户端 载地址:http://www.zabbix.com/download.php 选择windows版本的agent下载 从官方下载Zabbix Agent后,压缩 ...

  9. zabbix server、agent安装及使用

    先准备yum源,当然你有打好的rpm包那更好 [root@linux-node1 ~]# cat /etc/yum.repos.d/zabbix.repo [zabbix] name=Zabbix O ...

随机推荐

  1. 轻量级应用开发之(08)UITableView

    一  UITableView基本介绍 在众多移动应⽤用中,能看到各式各样的表格数据 . 在iOS中,要实现表格数据展示,最常用的做法就是使用UITableView,UITableView继承自UISc ...

  2. MyBatis查询传一个参数时报错:There is no getter for property named 'sleevetype' in 'class java.lang.Integer

    用MyBatis进行查询,传入参数只有一个时(非Map)如int,报错 There is no getter for property named 'sleevetype' in 'class jav ...

  3. String与Date、Timestamp互转

    一.String与Date(java.util.Date)互转 1.1 String -> Date String dateStr = "2010/05/04 12:34:23&quo ...

  4. 关于Java类加载双亲委派机制的思考(附一道面试题)

    预定义类加载器和双亲委派机制 JVM预定义的三种类型类加载器: 启动(Bootstrap)类加载器:是用本地代码实现的类装入器,它负责将 <Java_Runtime_Home>/lib下面 ...

  5. Buy Tickets(线段树)

     Buy Tickets Time Limit:4000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Submit ...

  6. Charm Bracelet

    Charm Bracelet Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Subm ...

  7. unity3d webplayer 16:9 居中显示模板

    原地址:http://www.cnblogs.com/88999660/archive/2013/04/12/3016773.html <!DOCTYPE html PUBLIC "- ...

  8. lvs之ip-tun(ip隧道)技术的学习与实践

    1.配置测试环境 修改IP windows 200.168.10.4 lvs server  ip:200.168.10.1 因为IP隧道模式只需要一个网卡  所以就停掉其他网卡 web server ...

  9. ubuntu14.04 中国源

    deb http://cn.archive.ubuntu.com/ubuntu/ trusty main restricted universe multiversedeb http://cn.arc ...

  10. Recover Rotated Sorted Array

    Given a rotated sorted array, recover it to sorted array in-place. Clarification What is rotated arr ...