一、服务器安装:
# 下载zabbix源deb包
wget https://mirrors.aliyun.com/zabbix/zabbix/5.4/debian/pool/main/z/zabbix-release/zabbix-release_5.4-1+debian10_all.deb
# 安装zabbix源deb
dpkg -i zabbix-release_5.4-1+debian10_all.deb
# zabbix源修改至阿里云
echo deb https://mirrors.aliyun.com/zabbix/zabbix/5.4/debian buster main|tee /etc/apt/sources.list.d/zabbix.list
# zabbix源修改至阿里云
echo deb-src https://mirrors.aliyun.com/zabbix/zabbix/5.4/debian buster main|tee -a /etc/apt/sources.list.d/zabbix.list
# 更新镜像源列表
apt update
# 安装zabbix所需包
apt install zabbix-server-mysql zabbix-frontend-php zabbix-nginx-conf zabbix-sql-scripts zabbix-agent
# 安装数据库
apt install -y mariadb-server
# 数据库初始化
mysql_secure_installation
# 登录数据库
mysql -u root -p
# 创建zabbix数据库并设置编码为utf-8
create database zabbix character set utf8 collate utf8_bin;
# 创建mariadb用户zabbix
create user zabbix@localhost identified by '密码';
# 授权zabbix用户访问zabbix数据库
grant all privileges on zabbix.* to zabbix@localhost;
# 退出mariadb
quit;
# 导入初始数据至zabbix库
zcat /usr/share/doc/zabbix-sql-scripts/mysql/create.sql.gz | mysql -uzabbix -p zabbix
# 编辑zabbix服务端配置文件
nano /etc/zabbix/zabbix_server.conf
# 配置数据库密码
DBPassword=密码
# 配置缓存长度为2048M
CacheSize=2048M
# 编辑nginx配置文件
nano /etc/zabbix/nginx.conf
# 监听端口配置
listen 80;
# 服务器主机名配置
server_name _;
# 删除默认站点配置
rm -rf /etc/nginx/sites-enabled/default
# 重启相关服务
systemctl restart zabbix-server zabbix-agent nginx php7.3-fpm
# 相关服务开启开机自动启动
systemctl enable zabbix-server zabbix-agent nginx php7.3-fpm mariadb
二、修改字体:
# 上传C:\Windows\Fonts\simfang.ttf字体至/usr/share/zabbix/assets/fonts/simfang.ttf
# 修改zabbix前端配置文件
nano /usr/share/zabbix/include/defines.inc.php
# define('ZBX_GRAPH_FONT_NAME', 'graphfont')
define('ZBX_GRAPH_FONT_NAME', 'simfang');
# define('ZBX_FONT_NAME', 'graphfont')
define('ZBX_FONT_NAME', 'simfang');
三、默认密码:
-
Admin
-
zabbix
四、华为交换机snmp配置:
# 开启snmp
snmp-agent
# 设置设备联系方式
snmp-agent sys-info contact 0379-xxxxxxxx
# 设置设备地址
snmp-agent sys-info location ZHL-1F
# 设置snmpv2只读团体名
snmp-agent community read Readpublic
# 设置snmp版本
snmp-agent sys-info version v2c v3
五、参考资料:
- zabbix模板库: https://share.zabbix.com
- 华为oid查询: https://support.huawei.com/mibtoolweb/enterpriseMibInfo/zh
- 华为工具库: https://support.huawei.com/enterprise/zh/tool
- zabbix报表工具: https://www.zabbix.org.cn/viewtopic.php?f=12&t=7559