参考:https://blog.csdn.net/xiaocong66666/article/details/82818893

安装所需的依赖包即可:
yum install gcc gcc-c++ autoconf automake zlib zlib-devel openssl openssl-devel pcre pcre-devel -y

官网下载源码:

上传到contos7系统

解压: tar -zxvf zabbix-4.0.0.tar.gz

进入解压文件执行安装命令:

./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2

备注:
--prefix=/usr/local/zabbix  本次安装的路径
--enable-server --enable-agent表示即安装server也安装agent

make&&make install

# rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
# yum clean all

yum -y install zabbix-server-mysql zabbix-web-mysql

参考网址:https://blog.csdn.net/rujianxuezha/article/details/79842998

rpm -ivh https://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm

yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-get

cd  /usr/share/doc/zabbix-server-mysql-3.0.28

zcat create.sql.gz | mysql  zabbix

参考网址:https://blog.csdn.net/u013569329/article/details/82685295

移除已经安装的zabbix命令:

yum remove zabbix-release

yum clean all

cd /etc/yum.repos.d/
vim zabbix.repo #看看和操作系统的版本与yum源是否匹配,如果没有该文件就不用管

yum -y install unixODBC (连接数据库的组件,可以不用安装)

wget http://repo.zabbix.com/zabbix/3.4/rhel/6/x86_64/zabbix-release-3.4-1.el6.noarch.rpm
rpm -ivh zabbix-release-3.4-1.el6.noarch.rpm
yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent

yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent   --skip-broken

卸载 rpm  中不要的包:https://www.cnblogs.com/wei9593/p/10856899.html

查看安装的 zabbix

rpm -qa | grep zabbix

rpm -e zabbix-release-4.0-2.el7.noarch  :rpm -e 命令删除 yum中的rpm包

rpm -e --nodeps  zabbix-release-4.0-2.el7.noarch :rpm -e --nodeps 强制删除

卸载安装错的zabbix: find / -name zabbix

删除 cd /etc/yum.repos.d/   下的 zabbix.repo文件

yum -y update   :更新yum为最新

cat /etc/redhat-release

cat /proc/version    看版本,看内核

关闭selinux

vi /etc/selinux/config    #将SELINUX=enforcing改为SELINUX=disabled 设置后需要重启才能生效

setenforce 0       #临时关闭命令

getenforce         #检测selinux是否关闭,Disabled 为关闭

firewall-cmd --state 

systemctl stop firewalld.service    #临时关闭firewall
systemctl disable firewalld.service #禁止firewall开机启动

cd /etc/yum.repos.d/       cat zabbix.repo 查看文件夹下的zabbix.repo文件

1.服务器已经安装lampp

2.在监控机创建监控数据库并授权

mysql -u root 
mysql> create database zabbix default character set utf8;
mysql> grant select,insert,update,delete,create on zabbix.* to 'zabbix_user'@'localhost' identified by '123456';
mysql>grant all privileges on *.* to 'zabbix_user'@'%' identified by '123456';
mysql> flush privileges;
    quit;      退出数据库命令
 
按 ctrl+z:退出数据库
 
 
zabbix安装命令:
 
# rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
# yum clean all
# yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent
   yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent  --skip-broken
 
 
创建数据库及访问的用户名和密码:
# mysql -uroot -p
password
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'password';
mysql> quit;
 
 
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql zabbix    :创建数据库 中zabbix 库中的表
 
配置/etc/zabbix/zabbix_server.conf:

### Option: DBPassword
# Database password.
# Comment this line if no password is used.
#
# Mandatory: no
# Default:
# DBPassword=

修改为

### Option: DBPassword
# Database password.
# Comment this line if no password is used.
#
# Mandatory: no
# Default:
DBPassword=password
e. Configure PHP for Zabbix frontend

Edit file /etc/httpd/conf.d/zabbix.conf, uncomment and set the right timezone for you. # php_value date.timezone Europe/Riga

f. Start Zabbix server and agent processes

Start Zabbix server and agent processes and make it start at system boot:

# systemctl restart zabbix-server zabbix-agent httpd
# systemctl enable zabbix-server zabbix-agent httpd

Now your Zabbix server is up and running!

Zabbix 4.0 LTS下载地址:https://www.zabbix.com/download_sources#tab:40LTS

参考官网:https://www.zabbix.com/download?zabbix=4.0&os_distribution=centos&os_version=7&db=mysql

 
 
 
 

centos7搭建zabbix的更多相关文章

  1. zabbix系列(一)centos7搭建zabbix3.0.4服务端及配置详解

    1.安装常用的工具软件 yum install -y vim wget centos7关闭防火墙 systemctl stop firewalld.service systemctl disable ...

  2. CentOS7下搭建zabbix监控(四)——Zabbix报警设置

    CentOS7下搭建zabbix监控(一)——Zabbix监控端配置 CentOS7下搭建zabbix监控(二)——Zabbix被监控端配置 CentOS7下搭建zabbix监控(三)——Zabbix ...

  3. CentOS7下搭建zabbix监控(三)——Zabbix监控服务配置

    CentOS7下搭建zabbix监控(一)——Zabbix监控端配置 CentOS7下搭建zabbix监控(二)——Zabbix被监控端配置 (1).配置Zabbix监控Apache服务 主机名:yo ...

  4. CentOS7下搭建zabbix监控(二)——Zabbix被监控端配置

    Zabbix监控端配置请查看:CentOS7下搭建zabbix监控(一)——Zabbix监控端配置 (1).在CentOS7(被监控端)上部署Zabbix Agent 主机名:youxi2 IP地址: ...

  5. centos7搭建zabbix3.0监控系统

    关闭防火墙和selinux systemctl stop firewalld.service                (停止防火墙) systemctl disable firewalld.se ...

  6. 搭建zabbix监控系统详解

    搭建zabbix监控系统详解 文:warren   博文大纲:一.前言 二.zabbix监控架构三.搭建Zabbix监控服务器四.搭建过程中遇到有些服务无法正常启动的解决办法 一.前言 : 要想实时的 ...

  7. centos7 搭建GlusterFS

    centos7 搭建GlusterFS 转载http://zhaijunming5.blog.51cto.com/10668883/1704535 实验需求:4台机器安装GlusterFS组成一个集群 ...

  8. docker搭建zabbix

    本次使用docker搭建zabbix的组合是mysql+docker+zabix-server 1 先安装数据库mysql docker run --name zabbix-mysql-server ...

  9. CentOS 6.5 搭建 Zabbix

    CentOS 6.5 搭建 Zabbix 说明: 操作系统:CentOS 6.5 IP地址:192.168.21.127 Web环境:Nginx+MySQL+PHP zabbix版本:Zabbix 2 ...

随机推荐

  1. count(1)比count(*)效率高?

    SELECT COUNT(*) FROM table_name是个再常见不过的统计需求了. 本文带你了解下Mysql的COUNT函数. 一.COUNT函数 关于COUNT函数,在MySQL官网中有详细 ...

  2. C#的冒泡排序

    C#实现的从小到大的冒泡排序: public void BubbleSort(int[] array) { int length = array.Length; ; i < length - ; ...

  3. java 关于xlsx(xls) 和 csv 文件的数据解析

    1.适用于xlsx 和 xls  <!--xlsx和xls文件pom依赖--> <dependency> <groupId>org.apache.poi</g ...

  4. 题解 Luogu P3370

    讲讲这题的几种做法: 暴力匹配法 rt,暴力匹配,即把字符串存起来一位一位判相等 时间复杂度$ O(n^2·m) $ 再看看数据范围 \(n\le10^5,m\le10^3\) 当场爆炸.当然有暴力分 ...

  5. 安装PHP到CentOS(YUM)

    运行环境 系统版本:CentOS Linux release 7.3.1611 软件版本:PHP-7.2 硬件要求:无 安装过程 1.配置YUM源 [root@localhost ~]# rpm -i ...

  6. c#学习心得(2)

    1.foreach与IEnumerable和IEnumerator的结合使用????? using System; using System.Collections; class Program { ...

  7. idea git pull fatal: bad config line 1 in file /.gitconfig 问题处理

    在网上搜好多都是直接改username和useremail的,但是没有说明原理. 因为我的电脑是新入职接手上一家的电脑 后来在git bash 里面用$ git config user.name 原来 ...

  8. Python3标准库:bisect维护有序列表

    1. bisect维护有序列表 bisect模块实现了一个算法来向列表中插入元素,同时仍保持列表有序. 1.1 有序插入 下面给出一个简单的例子,这里使用insort()按有序顺序向一个列表中插入元素 ...

  9. 剑指offer-面试题41-数据流中的中位数-堆

    /* 题目: 链接:https://www.nowcoder.com/questionTerminal/9be0172896bd43948f8a32fb954e1be1 来源:牛客网 如何得到一个数据 ...

  10. composer封装dd函数

    1.安装composer,本人用的phpstudy,打开php扩展php_openssl 2.切换到www目录下 cmd 命令 composer 第一个就是我们要找的 3.运行composer req ...