Ubuntu操作系统部署zabbix agent服务

                              作者:尹正杰

版权声明:原创作品,谢绝转载!否则将追究法律责任。

一.下载zabbix软件包

  博主推荐阅读:
    https://www.cnblogs.com/yinzhengjie2020/p/12305427.html

二.编译安装agent

1>.将下载的软件包上传到服务器上

[root@mysql202.yinzhengjie.org.cn ~]# cd /usr/local/src/
[root@mysql202.yinzhengjie.org.cn /usr/local/src]#
[root@mysql202.yinzhengjie.org.cn /usr/local/src]# ll
total
drwxr-xr-x root root Aug ./
drwxr-xr-x root root Aug ../
[root@mysql202.yinzhengjie.org.cn /usr/local/src]#
[root@mysql202.yinzhengjie.org.cn /usr/local/src]# rz [root@mysql202.yinzhengjie.org.cn /usr/local/src]#
[root@mysql202.yinzhengjie.org.cn /usr/local/src]# ll
total
drwxr-xr-x root root Feb : ./
drwxr-xr-x root root Aug ../
-rw-r--r-- root root Feb : zabbix-4.0..tar.gz
[root@mysql202.yinzhengjie.org.cn /usr/local/src]#

2>.解压软件包

[root@mysql202.yinzhengjie.org.cn /usr/local/src]# ll
total
drwxr-xr-x root root Feb : ./
drwxr-xr-x root root Aug ../
-rw-r--r-- root root Feb : zabbix-4.0..tar.gz
[root@mysql202.yinzhengjie.org.cn /usr/local/src]#
[root@mysql202.yinzhengjie.org.cn /usr/local/src]# tar zxf zabbix-4.0..tar.gz
[root@mysql202.yinzhengjie.org.cn /usr/local/src]#
[root@mysql202.yinzhengjie.org.cn /usr/local/src]# ll
total
drwxr-xr-x root root Feb : ./
drwxr-xr-x root root Aug ../
drwxr-xr-x Jan : zabbix-4.0./
-rw-r--r-- root root Feb : zabbix-4.0..tar.gz
[root@mysql202.yinzhengjie.org.cn /usr/local/src]#
[root@mysql202.yinzhengjie.org.cn /usr/local/src]#

[root@mysql202.yinzhengjie.org.cn /usr/local/src]# tar zxf zabbix-4.0.17.tar.gz

3>.安装依赖环境

[root@mysql202.yinzhengjie.org.cn ~]# apt-get -y install libpcre3 libpcre3-dev gcc make

4>.配置zabbix agent的安装参数

[root@mysql202.yinzhengjie.org.cn /usr/local/src]# ll
total
drwxr-xr-x root root Feb : ./
drwxr-xr-x root root Aug ../
drwxr-xr-x Jan : zabbix-4.0./
-rw-r--r-- root root Feb : zabbix-4.0..tar.gz
[root@mysql202.yinzhengjie.org.cn /usr/local/src]#
[root@mysql202.yinzhengjie.org.cn /usr/local/src]# cd zabbix-4.0./
[root@mysql202.yinzhengjie.org.cn /usr/local/src/zabbix-4.0.]#
[root@mysql202.yinzhengjie.org.cn /usr/local/src/zabbix-4.0.]# ll
total
drwxr-xr-x Jan : ./
drwxr-xr-x root root Feb : ../
-rw-r--r-- Jan : aclocal.m4
-rw-r--r-- Jan : AUTHORS
drwxr-xr-x Jan : bin/
drwxr-xr-x Jan : build/
-rw-r--r-- Jan : ChangeLog
-rwxr-xr-x Jan compile*
drwxr-xr-x Jan : conf/
-rwxr-xr-x Nov config.guess*
-rwxr-xr-x Nov config.sub*
-rwxr-xr-x Jan : configure*
-rw-r--r-- Jan : configure.ac
-rw-r--r-- Jan : COPYING
drwxr-xr-x Jan : database/
-rwxr-xr-x Jan depcomp*
drwxr-xr-x Jan : frontends/
drwxr-xr-x Jan : include/
-rw-r--r-- Jan : INSTALL
-rwxr-xr-x Jan install-sh*
drwxr-xr-x Jan : m4/
-rw-r--r-- Jan : Makefile.am
-rw-r--r-- Jan : Makefile.in
drwxr-xr-x Jan : man/
drwxr-xr-x Jan : misc/
-rwxr-xr-x Jan missing*
-rw-r--r-- Jan : NEWS
-rw-r--r-- Jan : README
drwxr-xr-x Jan : sass/
drwxr-xr-x Jan : src/
[root@mysql202.yinzhengjie.org.cn /usr/local/src/zabbix-4.0.]#

[root@mysql202.yinzhengjie.org.cn /usr/local/src]# cd zabbix-4.0.17/

[root@mysql202.yinzhengjie.org.cn /usr/local/src/zabbix-4.0.]# ./configure --prefix=/yinzhengjie/softwares/zabbix --enable-agent

5>.编译并安装

[root@mysql202.yinzhengjie.org.cn /usr/local/src/zabbix-4.0.]# make -j  && make install

6>.编写zabbix agent的启动脚本

  博主推荐阅读:
    https://www.cnblogs.com/yinzhengjie2020/p/12306215.html

三.手动启动zabbix agent程序

1>.修改zabbix agent的配置文件,指定zabbix server地址

[root@mysql202.yinzhengjie.org.cn ~]# cp /yinzhengjie/softwares/zabbix/etc/zabbix_agentd.conf /yinzhengjie/softwares/zabbix/etc/zabbix_agentd.conf-`date +%F`        #修改配置文件之前别忘记先备份文件
[root@mysql202.yinzhengjie.org.cn ~]# grep ^Server= /yinzhengjie/softwares/zabbix/etc/zabbix_agentd.conf
Server=127.0.0.1
[root@mysql202.yinzhengjie.org.cn ~]#
[root@mysql202.yinzhengjie.org.cn ~]# sed -r -i 's#(Server=)127.0.0.1#\1172.200.5.203#' /yinzhengjie/softwares/zabbix/etc/zabbix_agentd.conf
[root@mysql202.yinzhengjie.org.cn ~]#
[root@mysql202.yinzhengjie.org.cn ~]# grep ^Server= /yinzhengjie/softwares/zabbix/etc/zabbix_agentd.conf
Server=172.200.5.203
[root@mysql202.yinzhengjie.org.cn ~]#
[root@mysql202.yinzhengjie.org.cn ~]#

[root@mysql202.yinzhengjie.org.cn ~]# sed -r -i 's#(Server=)127.0.0.1#\1172.200.5.203#' /yinzhengjie/softwares/zabbix/etc/zabbix_agentd.conf

[root@mysql202.yinzhengjie.org.cn ~]# grep ^Hostname= /yinzhengjie/softwares/zabbix/etc/zabbix_agentd.conf
Hostname=Zabbix server
[root@mysql202.yinzhengjie.org.cn ~]#
[root@mysql202.yinzhengjie.org.cn ~]#
[root@mysql202.yinzhengjie.org.cn ~]# sed -r -i 's#(Hostname=)Zabbix server#\1mysql202.yinzhengjie.org.cn#' /yinzhengjie/softwares/zabbix/etc/zabbix_agentd.conf
[root@mysql202.yinzhengjie.org.cn ~]#
[root@mysql202.yinzhengjie.org.cn ~]# grep ^Hostname= /yinzhengjie/softwares/zabbix/etc/zabbix_agentd.conf
Hostname=mysql202.yinzhengjie.org.cn
[root@mysql202.yinzhengjie.org.cn ~]#
[root@mysql202.yinzhengjie.org.cn ~]#

[root@mysql202.yinzhengjie.org.cn ~]# sed -r -i 's#(Hostname=)Zabbix server#\1mysql202.yinzhengjie.org.cn#' /yinzhengjie/softwares/zabbix/etc/zabbix_agentd.conf

2>.修改zabbix的守护进程为root用户(默认是zabbix用户)

[root@mysql202.yinzhengjie.org.cn ~]# grep User= /yinzhengjie/softwares/zabbix/etc/zabbix_agentd.conf
# User=zabbix
[root@mysql202.yinzhengjie.org.cn ~]#
[root@mysql202.yinzhengjie.org.cn ~]# sed -r -i 's@# (User=)zabbix@\1root@' /yinzhengjie/softwares/zabbix/etc/zabbix_agentd.conf
[root@mysql202.yinzhengjie.org.cn ~]#
[root@mysql202.yinzhengjie.org.cn ~]# grep User= /yinzhengjie/softwares/zabbix/etc/zabbix_agentd.conf
User=root
[root@mysql202.yinzhengjie.org.cn ~]#
[root@mysql202.yinzhengjie.org.cn ~]#

[root@mysql202.yinzhengjie.org.cn ~]# sed -r -i 's@# (User=)zabbix@\1root@' /yinzhengjie/softwares/zabbix/etc/zabbix_agentd.conf

[root@mysql202.yinzhengjie.org.cn ~]# grep AllowRoot= /yinzhengjie/softwares/zabbix/etc/zabbix_agentd.conf
# AllowRoot=
[root@mysql202.yinzhengjie.org.cn ~]#
[root@mysql202.yinzhengjie.org.cn ~]# sed -r -i 's@# (AllowRoot=)0@\11@' /yinzhengjie/softwares/zabbix/etc/zabbix_agentd.conf
[root@mysql202.yinzhengjie.org.cn ~]#
[root@mysql202.yinzhengjie.org.cn ~]# grep AllowRoot= /yinzhengjie/softwares/zabbix/etc/zabbix_agentd.conf
AllowRoot=
[root@mysql202.yinzhengjie.org.cn ~]#
[root@mysql202.yinzhengjie.org.cn ~]#

[root@mysql202.yinzhengjie.org.cn ~]# sed -r -i 's@# (AllowRoot=)0@\11@' /yinzhengjie/softwares/zabbix/etc/zabbix_agentd.conf

3>.启动zabbix agent服务

[root@mysql202.yinzhengjie.org.cn ~]# ss -ntl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 172.200.5.202: 0.0.0.0:*
LISTEN 127.0.0.53%lo: 0.0.0.0:*
LISTEN 0.0.0.0: 0.0.0.0:*
LISTEN [::]: [::]:*
[root@mysql202.yinzhengjie.org.cn ~]#
[root@mysql202.yinzhengjie.org.cn ~]# /yinzhengjie/softwares/zabbix/sbin/zabbix_agentd
[root@mysql202.yinzhengjie.org.cn ~]#
[root@mysql202.yinzhengjie.org.cn ~]# ss -ntl
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 172.200.5.202: 0.0.0.0:*
LISTEN 127.0.0.53%lo: 0.0.0.0:*
LISTEN 0.0.0.0: 0.0.0.0:*
LISTEN 0.0.0.0: 0.0.0.0:*
LISTEN [::]: [::]:*
[root@mysql202.yinzhengjie.org.cn ~]#
[root@mysql202.yinzhengjie.org.cn ~]#

[root@mysql202.yinzhengjie.org.cn ~]# /yinzhengjie/softwares/zabbix/sbin/zabbix_agentd

Ubuntu操作系统部署zabbix agent服务的更多相关文章

  1. CentOS操作系统部署zabbix agent服务

    CentOS操作系统部署zabbix agent服务 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.查看zabbix的官方手册 1>.点击下载 2>.查看Ubunt ...

  2. Ubuntu操作系统编写zabbix的启动管理脚本

    Ubuntu操作系统编写zabbix的启动管理脚本 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.修改zabbix的pid存放路径 1>.创建存放zabbix的pid目录 ...

  3. 运维监控-基于yum的方式部署 Zabbix Agent 4.0 版本

    运维监控-基于yum的方式部署 Zabbix Agent 4.0 版本 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 上一篇博客我们分享了如何基于yum的方式部署zabbix 4. ...

  4. centos6.5安装部署zabbix监控服务端和客户端

    部署zabbix服务端需要LNMP环境(nginx,mysql,php),其它数据库也可以,我这里使用mysql,关于LNMP环境部署,可以参考我的另一遍文章:http://www.cnblogs.c ...

  5. CentOS 7.2 Ubuntu 18部署Rsync + Lsyncd服务实现文件实时同步/备份

    发送端配置: 一.配置密钥 1. 主/从服务器之间启用基于密钥的身份验证.登录发送端服务器并用 " ssh-keygen " 命令生成公共或私有的密钥. 2. 使用 " ...

  6. Linux下Ubuntu 操作系统 部署

    1.1 先更新系统 环境 更新命令为: apt-get update 1.2 安装jdk 安装JDK命令为:sudo apt-get install o penjdk-7-jdk 1.3 安装tomc ...

  7. 通过ansible自动化部署zabbix应用

    zabbix在实际的应用中,可能需要监控的主机非常多,而每个主机的操作系统类型.版本也都不尽相同,在这种环境下,通过手动安装zabbix的agent端已经不现实了,此时就需要借助自动化工具完成zabb ...

  8. zabbix agent配置详解(windows)

    客户端操作  标注:监控zabbix_agentd客户端安装对象是win server 2008操作系统 64位. 1.  下载zabbix_agentd监控客户端软件安装包(windows操作系统客 ...

  9. Windows server 安装和配置zabbix agent

    1.下载Windows 平台的zabbix agent 先到官网下载zabbix_agentd监控客户端软件安装包(windows操作系统客户端),客户端版本尽量与服务器版本一致,下载地址:http: ...

随机推荐

  1. 理解WPF中的视觉树和逻辑树

    轉載地址:http://blog.csdn.net/changtianshuiyue/article/details/26981797 理解WPF中的视觉树和逻辑树  Understanding th ...

  2. C语言笔记 12_可变参数&内存管理&命令行参数

    可变参数 有时,您可能会碰到这样的情况,您希望函数带有可变数量的参数,而不是预定义数量的参数.C 语言为这种情况提供了一个解决方案,它允许您定义一个函数,能根据具体的需求接受可变数量的参数.下面的实例 ...

  3. 操作系统OS - 重装Windows7卡在completing installation

    1. shift + f10 2. cd oobe 3. Msoobe

  4. cmake学习资料收集

    CMake 学习笔记 : https://www.jianshu.com/p/c417e4ab8b30

  5. 语言国际化:中文ASC码互转

    https://javawind.net/tools/native2ascii.jsp 1.首先找到了上面的链接,也就是下图,输入中文就可立即得出ASCII码 2.看到上图第一条,找到了JDK/bin ...

  6. laravel API

    /** * [api] * @author Foreach * @param string $method [请求方式] * @param string $url [地址] * @param arra ...

  7. javaweb使用button的onclick属性访问servlet

    1.定义一个servlet: 如我定义了一个名称为Choose_class.java的servlet 2.定义一个button <input type="button"  v ...

  8. GO 空白标识符 _

    空白标识符 _ 也被用于抛弃值,如值 5 在:_, b = 5, 7 中被抛弃. _ 实际上是一个只写变量,你不能得到它的值.这样做是因为 Go 语言中你必须使用所有被声明的变量,但有时你并不需要使用 ...

  9. 8 HTML DOM 元素的查找与改变&改变CSS样式&HTML事件

    HTML DOM(Document Object Model)文档对象模型 当网页被加载时,浏览器会创建页面的文档对象模型. HTMLDOM 定义了用于HTML的一系列标准的对象.通过DOM,你可以访 ...

  10. 多线程server与多client通信

    鉴于ServerSocket的accept方法是阻塞的,那么只能通过多线程的方式实现多客户端连接与服务器连接 基本步骤: 1,服务端创建ServerSocket绑定端口号,循环调用accept()方法 ...