|NO.Z.00007|——————————|^^ 构建 ^^|——|Zabbix&LNMP&Server&Make.V2|

一、源码编译安装Zabbix Agent端(本机)
### --- 下载zabbix版本,各个版本之间安装方法相差不大,可以根据实际情况选择安装版本,本文版本为Zabbix-4.0.25.tar.gz。
~~~     zabbix源码下载地址(建议从官网下载):
~~~     https://www.zabbix.com/download_sources#tab:40LTS

### --- OR
[root@localhost ~]# wget -c https://cdn.zabbix.com/zabbix/sources/stable/4.0/zabbix-4.0.25.tar.gz  //-c:断点续传
[root@localhost ~]# md5sum zabbix-4.0.25.tar.gz                                       // 查看他的md5值
0694c540b1d014cdc5c6a50d361d77f2  zabbix-4.0.25.tar.gz
~~~     因为zabbix基于C语言开发;安装编译时依赖包、库文件:
~~~     本机不用安装,编译zabbix_server时已安装

[root@localhost ~]# yum -y install gcc curl curl-devel net-snmp net-snmp-devel perl-DBI libxml2-devel libevent-devel pcre mysql-devel
二、编译安装zabbix-Agent:
### --- 编译安装zabbix-Agent:
### --- 解压zabbix-4.0.25.tar.gz
~~~     -x extract解压,-z gzip压缩,-v verbose详细,-f file文件

[root@localhost ~]# tar -xzvf zabbix-4.0.25.tar.gz   
### --- zabbix-server编译安装,需要通过源代码部署三个步骤:
### --- 预编译:
~~~     --prefix=/usr/local/zabbix :源码安装目录绝对路径   
~~~     --enable-agent : 开启核心组件agent; 
~~~     --with-mysql=源码地址 :若mysql是源码安装的,需把mysql的安装库指导源代码的安装目录;
~~~     --enable-ipv6 :开启IPV6,后续支持IPV6监控,  
~~~     --with-net-snmp:通过snmp监控客户端   
~~~     --with-libcurl:支持curl,去获取网页的关键词,做web监控是用到库文件  
~~~     --with-libxml2:web接口

[root@localhost zabbix-4.0.25]# ./configure --prefix=/usr/local/zabbix  --enable-agent  --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl  --with-libxml2  
[root@localhost zabbix-4.0.25]# ./configure --help  |more               // 查看每个参数的含义,
### --- 编译
[root@localhost zabbix-4.0.25]# make

### --- 安装:
[root@localhost zabbix-4.0.25]# make install 

### --- 添加软链接(相当于快捷方式);启动脚本要找/usr/local/sbin;不然启动时会报错
[root@localhost ~]# ln -s /usr/local/zabbix/sbin/zabbix_agentd /usr/local/sbin/
### --- 同时cp zabbix_server启动脚本至/etc/init.d/目录,
### --- 启动zabbix_agent Zabbix_agent默认监听端口为10050

[root@localhost zabbix-4.0.25]# cp  misc/init.d/tru64/zabbix_agentd  /etc/init.d/zabbix_agentd
[root@localhost ~]# chmod  o+x  /etc/init.d/zabbix_agentd
[root@localhost ~]# /etc/init.d/zabbix_agentd restart                   
三、zabbix-agent的监听端口为10050
### --- zabbix-agent的监听端口为10050

[root@localhost ~]# netstat -tunlp |grep -aw 10050
tcp        0      0 0.0.0.0:10050           0.0.0.0:*               LISTEN      14210/zabbix_agentd 
tcp6       0      0 :::10050                :::*                    LISTEN      14210/zabbix_agentd 

附录一:学习地址:
### --- 学习地址:
~~~     https://ke.qq.com/user/index/index.html#/plan/cid=2025906&tid=102127284&term_id=102127284

### --- 5.0教程:
~~~     https://blog.csdn.net/guowei189902/article/details/108220248
~~~     https://www.cnblogs.com/eeexu123/p/13387633.html?utm_source=tuicool

 
 
 
 
 
 
 
 
 

Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart
                                                                                                                                                   ——W.S.Landor

 

 

posted on   yanqi_vip  阅读(33)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示