zabbix|基于centos7系统编译安装zabbix4.2.6教程详解


今天主要介绍一下怎么编译安装zabbix4.2.6 , 因为是内网环境 , 没外网 , 所以就单独整一篇了~
zabbix官方网站:https://www.zabbix.com
zabbix官方镜像网站:https://repo.zabbix.com
zabbix|基于centos7系统编译安装zabbix4.2.6教程详解
本文插图

一、安装前准备 1、关闭selinux和防火墙
systemctl stop firewalldsystemctl disable firewalldsed -i "s/=enforcing/=disabled/g" /etc/selinux/configsetenforce 0
zabbix|基于centos7系统编译安装zabbix4.2.6教程详解
本文插图

2、配置yum源
for i in /etc/yum.repos.d/*.repodo cp $i ${i%.repo}_bakdonerm -rf /etc/yum.repos.d/*.repowget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/Centos-7.reposed -i "s#keepcache=0#keepcache=1#g" /etc/yum.confyum clean all &amp&amp yum makecache
3、yum安装
yum install net-snmp gcc libxml2-devel net-snmp-devel libevent-devel curl-devel httpd php php-mysql php-devel php-xml php-bcmath php-mbstring php-gd php-xmlwriter php-ldap -y
二、安装mysql数据库 下载地址:https://downloads.mysql.com/archives/community/
用脚本一键部署 , 此处略
zabbix|基于centos7系统编译安装zabbix4.2.6教程详解
本文插图

三、编译安装zabbix server 1、下载源码包

地址:https://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/4.2.6/zabbix-4.2.6.tar.gz
2、编译安装zabbix
【zabbix|基于centos7系统编译安装zabbix4.2.6教程详解】tar -xvf zabbix-4.2.6.tar.gz cd zabbix-4.2.6/./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml2make &amp&amp make install
zabbix|基于centos7系统编译安装zabbix4.2.6教程详解
本文插图

zabbix|基于centos7系统编译安装zabbix4.2.6教程详解
本文插图

3、编写zabbix_server自启动文件
vim /usr/lib/systemd/system/zabbix-server.service=============================================================[Unit] Description=Zabbix After=network.target [Service] Environment="CONFFILE=/usr/local/zabbix/etc/zabbix_server.conf" Type=forking Restart=on-failure PIDFile=/tmp/zabbix_server.pid KillMode=control-group ExecStart=/usr/local/zabbix/sbin/zabbix_server -c $CONFFILE ExecStop=/bin/kill -SIGTERM $MAINPIDRestartSec=10s[Install] WantedBy=multi-user.target=============================================================
4、编写zabbix_agent自启动文件

vim /usr/lib/systemd/system/zabbix_agent.service=============================================================[Unit]Description=Zabbix agentAfter=network.target[Service]Environment="CONFFILE=/usr/local/zabbix/etc/zabbix_agentd.conf"Type=forkingRestart=on-failurePIDFile=/tmp/zabbix_agentd.pidKillMode=control-groupExecStart=/usr/local/zabbix/sbin/zabbix_agentd -c $CONFFILEExecStop=/bin/kill -SIGTERM $MAINPIDRestartSec=10s[Install]WantedBy=multi-user.target=============================================================


推荐阅读