Ubuntu操作系统部署zabbix agent服务
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服务的更多相关文章
- CentOS操作系统部署zabbix agent服务
CentOS操作系统部署zabbix agent服务 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.查看zabbix的官方手册 1>.点击下载 2>.查看Ubunt ...
- Ubuntu操作系统编写zabbix的启动管理脚本
Ubuntu操作系统编写zabbix的启动管理脚本 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.修改zabbix的pid存放路径 1>.创建存放zabbix的pid目录 ...
- 运维监控-基于yum的方式部署 Zabbix Agent 4.0 版本
运维监控-基于yum的方式部署 Zabbix Agent 4.0 版本 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 上一篇博客我们分享了如何基于yum的方式部署zabbix 4. ...
- centos6.5安装部署zabbix监控服务端和客户端
部署zabbix服务端需要LNMP环境(nginx,mysql,php),其它数据库也可以,我这里使用mysql,关于LNMP环境部署,可以参考我的另一遍文章:http://www.cnblogs.c ...
- CentOS 7.2 Ubuntu 18部署Rsync + Lsyncd服务实现文件实时同步/备份
发送端配置: 一.配置密钥 1. 主/从服务器之间启用基于密钥的身份验证.登录发送端服务器并用 " ssh-keygen " 命令生成公共或私有的密钥. 2. 使用 " ...
- Linux下Ubuntu 操作系统 部署
1.1 先更新系统 环境 更新命令为: apt-get update 1.2 安装jdk 安装JDK命令为:sudo apt-get install o penjdk-7-jdk 1.3 安装tomc ...
- 通过ansible自动化部署zabbix应用
zabbix在实际的应用中,可能需要监控的主机非常多,而每个主机的操作系统类型.版本也都不尽相同,在这种环境下,通过手动安装zabbix的agent端已经不现实了,此时就需要借助自动化工具完成zabb ...
- zabbix agent配置详解(windows)
客户端操作 标注:监控zabbix_agentd客户端安装对象是win server 2008操作系统 64位. 1. 下载zabbix_agentd监控客户端软件安装包(windows操作系统客 ...
- Windows server 安装和配置zabbix agent
1.下载Windows 平台的zabbix agent 先到官网下载zabbix_agentd监控客户端软件安装包(windows操作系统客户端),客户端版本尽量与服务器版本一致,下载地址:http: ...
随机推荐
- JavaScript中关于隐式转换的一些总结
JavaScript运算符中的隐式转换规律:一.递增递减运算符(前置.后置)1.如果包含的是有效数字字符串或者是有效浮点数字符串,则会将字符串转换(Number())为数值,再进行加减操作,返回值的类 ...
- redis几种数据导出导入方式
一.redis-dump方式 1.安装redis-dump工具 [root@172.20.0.3 ~]# yum install ruby rubygems ruby-devel -y 更改gem源 ...
- Redis Set操作
public void CleanPur() { var typedClient = _redisClient.As<PurClass>(); typedClient.DeleteAll( ...
- day03-MyBatis的动态SQL语句查询
场景一: 例如当我们想实现这样的查询的时候之前的操作貌似满足不了我们. 场景二: 还有些时候我们如果输入的信息越多满足要求的就越多,所查找出来的用户就越少 当我们之输入姓名的时候可能查找出10个人, ...
- tomcat8配置了tomcat-users.xml,报403 Access Denied
配置了tomcat-users.xml之后,重启tomcat服务,仍然访问拒绝. 原因:tomcat8.5 更改之后,仍然访问拒绝. 还需步骤如下: vi /usr/local/tomcat/apac ...
- JS 表单相关
var title = $("#subjects option:selected").text();
- [HEOI 2013]SAO
Description 题库连接 给你一个 \(n\) 个节点的有向树,问你这棵树的拓扑序个数,对大质数取模.多测,测试组数 \(T\). \(1\leq n\leq 1000, 1\leq T\le ...
- 《容器化.NET应用架构指南》脑图学习笔记(第一部分)
一.关于这本官方“圣经” 作为.NET程序员,对于微软官方推动的架构示例总是特别关注,从PetShop到MusicStore再到eShopOnContainers,每一次关注,都会了解到业界最新的架构 ...
- springmvc面试问题
1.讲下SpringMvc和Struts1,Struts2的比较的优势 性能上Struts1>SpringMvc>Struts2 开发速度上SpringMvc和Struts2差不多,比St ...
- redhat 7.6 rsync 配置,实时同步脚本
1.查看rsync,并安装 yum install rsync -y 2.配置/etc/rsyncd.conf文件 建议cp一份作为备份,清空内容复制以下配置 [服务端配置]log file = /v ...