zabbix4.0.21简单部署

                                                                     zabbix4.0.21部署

                                                                
 

http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/

下载  

配置

启动


                                                                               

                                     下载

安装源

cat <<EOF > /etc/yum.repos.d/zabbix.repo 
[zabbix]
name=Zabbix Official Repository - \$basearch
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/4.2/rhel/7/\$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
 
[zabbix-non-supported]
name=Zabbix Official Repository non-supported - \$basearch 
baseurl=https://mirrors.aliyun.com/zabbix/non-supported/rhel/7/\$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=1
EOF
 
添加gpgkey
curl https://mirrors.aliyun.com/zabbix/RPM-GPG-KEY-ZABBIX-A14FE591 \
-o /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
 
curl https://mirrors.aliyun.com/zabbix/RPM-GPG-KEY-ZABBIX \
-o /etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
 添加之后即可使用
yum makecache -y

或者:

安装zabbix服务端,和客户端,mariadb数据库
 yum install -y zabbix-server-mysql zabbix-web-mysql
   zabbix-agent mariadb-server

                                                   配置

启动数据库开机自启
systemctl start   mariadb.service 
systemctl enable  mariadb.service 
创建zabbix库并授权zabbix用户
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by  'zabbix';
进入目录,导入表
cd /usr/share/doc/zabbix-server-mysql-4.0.5 
 zcat create.sql.gz |mysql -uzabbix  zabbix
 
# 修改zabbix配置文件
sed -i 's#\# DBPassword=#DBPassword=redhat#g' /etc/zabbix/zabbix_server.conf
# 根据具体配置修改配置文件,当前为一台server,大多为默认,(示例参数配置)
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
 
 
配置PHP时区:
# 配置Apache与Php配置
sed -i 's#\# php_value date.timezone Europe/Riga#php_value date.timezone Asia/Shanghai#g' /etc/httpd/conf.d/zabbix.conf
 
 

                                                 启  动

启动zabbix相关服务:
systemctl start zabbix-server && systemctl enable  zabbix-server
systemctl start httpd && systemctl enable httpd
 
额外补充~
修改zabbix web界面字体 
 cd /etc/alternatives/
 
cd   /usr/share/fonts/dejavu
mv DejaVuSans.ttf DejaVuSans.ttf.bak
电脑  C:\Windows\Fonts拉出来一个字体并上传替换掉
 
mv msyh.ttc  DejaVuSans.ttf
刷新zabbix web页面即可
 
 

 

posted @ 2020-06-28 10:52  名字长的像一只老山羊  阅读(147)  评论(0编辑  收藏  举报