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: ...
随机推荐
- nyoj 34
题目:http://acm.nyist.edu.cn/JudgeOnline/problem.php?pid=34 思路:第一种方法是枚举10~100进行计算判断,第二种方法是孙子定理,最近正好学了一 ...
- input和button 高度不一致问题
原因是 input和button的高度计算不一样, input高度不包括border. button高度包括border. 解决方法: 1.box-sizing:border-box: 2.borde ...
- Oracle忘记密码怎么办?
1.打开cmd,输入sqlplus /nolog,回车:输入“conn / as sysdba”;输入“alter user sys identified by 新密码”,注意:新密码最好以字母开头, ...
- day4-2数组及方法
数组: Js数组 可以存放任意数据类型的数据 如果索引大于数组的长度,数组自动增加到该索引值加1的长度 var arr = ["terry","larry",& ...
- 重新学习CSS,认识CSS3中的属性
之前学css,觉得会改个样式就不错了,直到现在,在做前端开发的时候,才发现自己的前端页面是有多垃圾,而且还不知道该怎么适应各个浏览器,总是很“词穷”,最近是想着好久没去慕课上面了,于是就报着逛一逛的心 ...
- Java基础 -2.2
整形数据 保存的范围由小到大:byte.short.int.long 在java中任何的一个整型常量 那么其默认的类型都是int型(只要是整数就是int类型的数据). public class ex1 ...
- node.js绑定监听事件EventEmitter类
Node.js 有多个内置的事件,我们可以通过引入 events 模块,并通过实例化 EventEmitter 类来绑定和监听事件,如下: // 引入 events 模块 var events = r ...
- 时间戳转分秒 | 字符串的padStart()和padEnd()
function _pad(num, n = 2) { let len = num.toString().length while (len < n) { num = '0' + num len ...
- 谷歌下,因为给外层大容器设置 overflow:visible; 而导致问题,IE、火狐正常
#selector { height: auto !important; width: 1024px!important; margin: auto; overflow:visible !import ...
- [转]ubuntu备份与恢复
在 使用Ubuntu之前,相信很多人都有过使用Windows系统的经历.如果你备份过Windows系统,那么你一定记忆犹新:首先需要找到一个备份工 具(通常都是私有软件),然后重启电脑进入备份工具提供 ...