centos7 yum安装zabbix4.0

1、添加清华大学软件源:

将以下内容写入 /etc/yum.repos.d/CentOS-Base.repo

选择你的 CentOS 版本:      
CentOS 5
    
CentOS 6
    
CentOS 7

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

更新软件包缓存 sudo yum makecache

2、下载清华软件源的rpm包:

wget https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/zabbix-server-mysql-4.0.14-1.el7.x86_64.rpm

wget https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/zabbix-web-4.0.14-1.el7.noarch.rpm

wget https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/zabbix-web-mysql-4.0.14-1.el7.noarch.rpm

wget https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/zabbix-agent-4.0.14-1.el7.x86_64.rpm

wget https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/4.0/rhel/7/x86_64/zabbix-get-4.0.14-1.el7.x86_64.rpm

yum -y localinstall zabbix-server-mysql-4.0.14-1.el7.x86_64.rpm

yum -y localinstall zabbix-web-4.0.14-1.el7.noarch.rpm

yum -y localinstall zabbix-web-mysql-4.0.14-1.el7.noarch.rpm

yum -y localinstall zabbix-agent-4.0.14-1.el7.x86_64.rpm

yum -y localinstall zabbix-get-4.0.14-1.el7.x86_64.rpm

gunzip /usr/share/doc/zabbix-server-mysql-4.0.14/create.sql.gz

3、安装数据库mariadb并配置:

yum install mariadb mariadb-server
systemctl start mariadb   #启动mariadb
systemctl enable mariadb  #设置开机自启动
mysql_secure_installation #设置root密码等相关
mysql -uroot -p           #测试登录

create database zabbix;

grant all on zabbix.* to [email protected]‘127.0.0.1‘ identified by ‘zabbix123‘;

source /usr/share/doc/zabbix-server-mysql-4.0.14/create.sql

vi /etc/zabbix/zabbix_server.conf

修改DBhost为127.0.0.1:

### Option: DBHost
# Database host name.
# If set to localhost, socket is used for MySQL.
# If set to empty string, socket is used for PostgreSQL.
#
# Mandatory: no
# Default:
# DBHost=localhost
DBHost=127.0.0.1

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

vi /etc/php.ini

[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
;date.timezone =
date.timezone = Asia/shanghai

4、启动zabbix-server agent和apache :

systemctl start zabbix-server zabbix-agent httpd

在浏览器访问 ip/zabbix 即可进入web配置页面

原文地址:https://www.cnblogs.com/ValyrianSteel/p/12184719.html

时间: 2024-10-01 02:13:44

centos7 yum安装zabbix4.0的相关文章

CentOS7.6使用yum安装MySQL8.0

CentOS7.6使用yum安装MySQL8.0 1.yum仓库下载MySQL:sudo yum localinstall https://dev.mysql.com/get/mysql80-community-release-el7-2.noarch.rpm 2.yum安装MySQL:sudo yum install mysql-community-server 3.启动MySQL服务:sudo service mysqld start 4.检查MySQL服务状态:sudo service m

centos7抢先安装docker1.0

1.关闭selinux [[email protected] ~]#setenforce 0 2.安装 Fedora EPEL [[email protected] ~]#yum install -y http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm 3.安装docker [[email protected] ~]#yum install -y docker-io [[email protecte

Centos7.2安装zabbix3.0

Centos7.2YUM安装zabbix3.0 防火墙和selinux关闭,这个我就不说了. 1.启动apache yum -y install httpd systemctl start httpd.service systemctl enable httpd.service systemctl status httpd.service 2. 启动mariadb yum install mariadb mariadb-server -y systemctl start mariadb syst

CentOS7.X部署Zabbix4.0

环境搭建在CenOS7.X里面部署Zabbix最好先搭建好环境,我这里使用的是PHP+MariaDB+httpd部署的. 部署PHP环境:yum install -y php php-php-fpm修改 PHP 参数以安装 ZABBIX 的安装需求: date.timezone = Asia/Shanghaimax_execution_time = 300post_max_size = 32Mmax_input_time = 300memory_limit = 128Mmakefile启动 PH

Centos7 yum安装nginx

centos7 yum 安装nginx 1.添加Nginx到YUM源 添加CentOS 7 Nginx yum资源库,打开终端,使用以下命令: sudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm 2.安装Nginx 在你的CentOS 7 服务器中使用yum命令从Nginx源服务器中获取来安装Nginx: yum install -y ng

centos7.6 安装redis5.0.4 单机

centos7.6 安装redis5.0.4 查看列表http://download.redis.io/releases/ 目前最新版稳定版为5.0.6 [ ] redis-5.0.6.tar.gz [[email protected]_147_31_centos src]# cat /etc/redhat-release CentOS Linux release 7.6.1810 (Core) [[email protected]_147_31_centos src]# uname -aLin

CentOS7使用yum安装MySQL8.0

1.yum仓库下载MySQL:sudo yum localinstall https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm 2.yum安装MySQL:sudo yum install mysql-community-server 3.启动MySQL服务:sudo service mysqld start 4.检查MySQL服务状态:sudo service mysqld status 5.查看初始密码(如无内容直

Centos7 Yum安装 PHP5.5,5.6,7.0

默认的版本太低了,手动安装有一些麻烦,想采用Yum安装的可以使用下面的方案: 1.检查当前安装的PHP包 yum list installed | grep php 如果有安装的PHP包,先删除他们 yum remove php.x86_64 php-cli.x86_64 php-common.x86_64 php-gd.x86_64 php-ldap.x86_64 php-mbstring.x86_64 php-mcrypt.x86_64 php-mysql.x86_64 php-pdo.x8

centos7.3安装php7.0

需求:在Centos7.3下搭建LNMP环境 文章转载自:http://blog.csdn.net/wszll_alex/article/details/76285324 作者:狂热森林 1. 关闭防火墙和selinux 打开文件selinux vim /etc/sysconfig/selinux 将文件中SELINUX=enforcing改为disabled,然后执行"setenforce 0″不用重启地关闭selinux. SELINUX=disabled 关闭放火墙 systemctl s