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: ...
随机推荐
- MBR扇区故障修复!
一:进行分区且格式化硬盘 [root@roomc~]#mkfs -t ext4 /dev/sdb1 //格式化sdb1盘 二:模拟破坏/sda主硬盘破坏再修复! [root@roomc~]#mk ...
- http协议学习 —— post请求方法提交application/x-www-form-urlencoded类型的数据格式
先推荐一篇很不错的文章:https://imququ.com/post/four-ways-to-post-data-in-http.html 说一下,如果是自己编写底层,那么要注意了,不能只有提交数 ...
- linux压缩包管理
1.gzip 文件 ----> .gz格式的压缩包 2.bzip2 文件 ----> .bz2格式的压缩包 3.tar -- 不使用z/j参数 该命令只能对文件或目录打包 参数: c -- ...
- Java Web 前端资源文件的路径问题
WEB-INF是Java Web应用的安全目录,在部署时用于存放class文件.项目用到的库(jar包).Java Web应用的配置文件web.xml. 浏览器不能访问此目录下的资源,比如在WEB-I ...
- 001. 使用IDEA新建一个JAVA最简单的Spring MVC JAVAWEB程序
1. 我们打开一个空的IDEA 2. 选择Java之后点击Next 3. 点击Next创建空白工程 4. 给工程取个名字,叫MYIDEA 5. 勾选之后,点击This Window按钮 6. 我们可以 ...
- rc
1,协同过滤. 2,协方差:用来衡量,他们的变化趋势是不是一致的. 3,皮尔逊相关系数:-1,负相关.1:正相关. 4,用皮尔逊相关系数来算相关性是最多的.
- 数据库转换Mysql-Oracle之建表语句
Mysql建库语句(导出的): DROP TABLE IF EXISTS `tablename`; CREATE TABLE `tablename` ( `C_DI_CDE` varchar(40) ...
- Windows对应的"Hello,world"程序
<Windows程序设计>(第五版)(美Charles Petzold著) https://docs.microsoft.com/zh-cn/windows/desktop/apiinde ...
- 李德胜系列——李德胜和CPC人的初心
很久很久以前,有三条恶龙盘踞着村庄,恶龙们及其爪牙对村民敲骨吸髓,逼着村民卖儿鬻女.苦不堪言.但是村民们却对此压迫习以为常,逆来顺受. 后来,一个书生来到了这个村庄,告诉村民,不许跪,也没有人值得他们 ...
- android悬浮按钮(Floating action button)的两种实现方法
原文: http://www.jcodecraeer.com/a/anzhuokaifa/androidkaifa/2014/1028/1857.html 最近android中有很多新的设计规范被引入 ...