zabbix 安装
https://www.zabbix.com/download
环境
192.168.48.55 zabbix
准备
zabbix源
rpm -Uvh https://repo.zabbix.com/zabbix/4.2/rhel/7/x86_64/zabbix-release-4.2-1.el7.noarch.rpm
epel源
cat > /etc/yum.repos.d/epel.repo << EOF
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/7/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 7 - $basearch - Debug
baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/7/$basearch/debug
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1
[epel-source]
name=Extra Packages for Enterprise Linux 7 - $basearch - Source
baseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/7/SRPMS
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7
gpgcheck=1
EOF
安装
安装zabbix
yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-get
创建mysql数据库
wget -c https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
rpm -ivh mysql80-community-release-el7-1.noarch.rpm
yum -y install yum-utils
yum-config-manager --disable mysql80-community
yum-config-manager --enable mysql57-community
yum install mysql-community-server -y
# 启动mysql
systemctl start mysqld
# 开机启动
systemctl enable mysqld
# 查看root临时密码
grep 'temporary password' /var/log/mysqld.log
# 使用mysql临时登录,修改root密码
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456@Abc';
# 创建zabbix用户和库
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by "Zabbix@123";
# 退出mysql,后导入zabbix数据
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p'Zabbix@123' zabbix
zabbix服务端配置
# 修改/etc/zabbix/zabbix_server.conf文件,修改mysql连接密码
DBPassword=Zabbix@123
# 添加上海区
sed -i.ori '19a php_value date.timezone Asia/Shanghai' /etc/httpd/conf.d/zabbix.conf
# 解决图形列表下中文乱码
yum -y install wqy-microhei-fonts
mv /usr/share/fonts/dejavu/DejaVuSans.ttf /usr/share/fonts/dejavu/DejaVuSans.ttf.bak
cp -f /usr/share/fonts/wqy-microhei/wqy-microhei.ttc /usr/share/fonts/dejavu/DejaVuSans.ttf
zabbix 启动
systemctl start zabbix-server httpd
# 开机启动
systemctl enable zabbix-server httpd
访问
http://192.168.48.55/zabbix
语言改为中文
开启zabbix agent
yum -y install zabbix-agent
配置文件/etc/zabbix/zabbix_agentd.conf
# 主要配置如下,默认即可
Server=127.0.0.1
ServerActive=127.0.0.1
Hostname=Zabbix server
# 启动zabbix客户端
systemctl start zabbix-agent
# 开机启动
systemctl enable zabbix-agent