概述
之前其实分享过zabbix监控指标的需求,所以后面主要介绍一下怎么去实现,这里先介绍一下部署zabbix的教程~
环境:
1、配置yum源
不配置repel源直接装zabbix-server会提示libmysqlclient.so.18()(64bit) 被 zabbix-server-mysql-4.2.6-1.el7.x86_64 需要
libmysqlclient.so.18(libmysqlclient_18)(64bit) 被 zabbix-server-mysql-4.2.6-1.el7.x86_64 需要
wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/Centos-7.repo >/dev/null 2>&1rpm -Uvh --force https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpmrpm -Uvh --force https://repo.zabbix.com/zabbix/4.2/rhel/7/x86_64/zabbix-release-4.2-2.el7.noarch.rpmyum clean all && yum makecache
2、安装zabbix Server/proxy/frontend
--install Zabbix serveryum -y install zabbix-server-mysql zabbix-web zabbix-web-mysql
常见报错:错误:软件包:zabbix-server-mysql-4.2.8-1.el7.x86_64 (zabbix需要libmysqlclient.so.18()
解决:
wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-community-libs-compat-5.7.24-1.el7.x86_64.rpmrpm -ivh mysql-community-libs-compat-5.7.24-1.el7.x86_64.rpm
3、创建及初始化数据库
安装数据库部分省略..
--创建数据库及用户set global validate_password_policy=0;create database zabbix default character set utf8 collate utf8_bin;grant all privileges on zabbix.* to zabbix@localhost identified by 'fxxxxxx';--初始化数据zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
4、修改zabbix配置文件
vim /etc/zabbix/zabbix_server.conf======================================================DBHost=localhost //在92行下添加DBPassword=fswl@1234 //在125行下添加======================================================vim /etc/httpd/conf.d/zabbix.conf======================================================php_value date.timezone Asia/Shanghai //在第20行修改======================================================
5、启动Zabbix服务器和代理进程
Zabbix-server监听的端口为:tcp 10051
Zabbix-agent监听的端口为:tcp 10050
systemctl restart zabbix-server zabbix-agent httpdsystemctl enable zabbix-server zabbix-agent httpd
6、图形界面配置
用浏览器访问地址:http://server_IP/zabbix
默认的用户为:Admin 密码:zabbix
安装后界面如下:
登录界面如下:
觉得有用的朋友多帮忙转发哦!后面会分享更多devops和DBA方面的内容,感兴趣的朋友可以关注下~