centos7安装zabbix 4.2

添加zabbix源
zabbix源地址 http://repo.zabbix.com

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

安装zabbix-server zabbix-agent zabbix-web
yum search zabbix在这里插入图片描述

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

启动数据库

systemctl start mariadb
mysql
MariaDB [(none)]>create database zabbix charset utf8;
MariaDB [(none)]>grant all on *.* to "zabbix"@'localhost' identified by '123';
MariaDB [(none)]>flush privileges;

导入初始数据到数据库中

zcat /usr/share/doc/zabbix-server-mysql-4.2.6/create.sql.gz | mysql -uzabbix -p123 zabbix

配置zabbix-server,能够连接到数据库,修改时区

vim /etc/zabbix/zabbix_server.conf
搜索 /DB 修改主机 用户 密码 等

	....
	DBHost=localhost
	DBName=zabbix
	DBUser=zabbix
	DBPassword=123

vim /etc/httpd/conf.d/zabbix.conf

php_value date.timezone Asia/Shanghai # 去掉注释,时区设置为亚洲,上海

关闭selinux firewalld 启动zabbix

systemctl stop firewalld
setenforce 0
systemctl start httpd zabbix-server zabbix-agent

修改支持中文字体

cd /usr/share/zabbix/assets/fonts

从Windows系统fonts中拉入字体 并修改名字为graphfont.ttf

mv SIMHEI.TTF graphfont.ttf

查看端口是否开启
netstat -ntlp | grep zabbix
10050 10051
登录zabbix
默认账号admin 密码zabbix

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
CentOS 7 安装 Zabbix 7.9 的步骤如下: 1. 安装必要的依赖包和软件源 ```shell sudo yum install epel-release -y sudo rpm -ivh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm ``` 2. 安装 Zabbix Server 和 Agent ```shell sudo yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent -y ``` 3. 安装 MySQL 数据库,并创建数据库和用户 ```shell sudo yum install mariadb-server -y sudo systemctl start mariadb.service sudo systemctl enable mariadb.service sudo mysql_secure_installation mysql -u root -p CREATE DATABASE zabbix character set utf8 collate utf8_bin; CREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost'; FLUSH PRIVILEGES; exit; ``` 4. 导入 Zabbix 数据库模板 ```shell zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -u zabbix -p zabbix ``` 5. 配置 Zabbix Server 编辑 Zabbix Server 配置文件 `/etc/zabbix/zabbix_server.conf`,修改以下参数: ```text DBPassword=password # 数据库密码,与之前创建用户时设置的密码一致 ``` 6. 启动 Zabbix Server 和 Agent,设置开机自启动 ```shell sudo systemctl start zabbix-server.service sudo systemctl enable zabbix-server.service sudo systemctl start zabbix-agent.service sudo systemctl enable zabbix-agent.service ``` 7. 配置防火墙 ```shell sudo firewall-cmd --add-service={http,https} --permanent sudo firewall-cmd --add-port={10050/tcp,10051/tcp} --permanent sudo firewall-cmd --reload ``` 8. 配置 Zabbix Web 界面 编辑 Zabbix Web 配置文件 `/etc/httpd/conf.d/zabbix.conf`,修改以下参数: ```text php_value date.timezone Asia/Shanghai # 修改时区 ``` 重启 Apache 服务: ```shell sudo systemctl restart httpd.service ``` 现在,您就可以通过浏览器访问 `http://<Server_IP>/zabbix` 来打开 Zabbix Web 界面了。默认的用户名和密码是 `Admin` 和 `zabbix`。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值