下载zabbix
在zabbix官网下载对应的rpm包
修改配置文件
vi /etc/yum.repos.d/epel.repo
[epel]
...
excludepkgs=zabbix*
#加载仓库
rpm -Uvh https://repo.zabbix.com/zabbix/7.0/centos/9/x86_64/zabbix-release-7.0-3.el9.noarch.rpm
dnf clean all
#安装Zabbix server,Web前端,agent
dnf install zabbix-server-mysql zabbix-web-mysql zabbix-nginx-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent
#配置mysql
mysql -uroot -p
password
mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
mysql> create user zabbix@localhost identified by 'password';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> set global log_bin_trust_function_creators = 1;
mysql> quit;
#导入mysql表
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
# 关闭权限控制
mysql -uroot -p
password
mysql> set global log_bin_trust_function_creators = 0;
mysql> quit;
# 修改zabbix密码
vi /etc/zabbix/zabbix_server.conf
DBPassword=password
# 打开nginx注释
vi /etc/nginx/conf.d/zabbix.conf
# listen 8080;
# server_name example.com;
# 启动并开机自启
systemctl restart zabbix-server zabbix-agent nginx php-fpm
systemctl enable zabbix-server zabbix-agent nginx php-fpm
配置中文字符,可以在网上下载 微软雅黑.ttf,上传到服务器/usr/share/fonts/dejavu
## 备份
[root@zabbix-server dejavu]# cp DejaVuSans.ttf DejaVuSans.ttf.bak
## 覆盖
[root@zabbix-server dejavu]# mv 微软雅黑.ttf DejaVuSans.ttf
重启即可
agent下载
linux
安装
firewall-cmd --zone=public --add-port=10050/tcp --permanent
firewall-cmd --reload
rpm -ivh zabbix-agent2-7.0.0-release1.el7.x86_64.rpm
vi /etc/zabbix/zabbix_agent2.conf
主要修改Server和hostname,因为这个是zabbix主机配置需要的,可以查阅相关资料
编写开机启动脚本
vi /etc/systemd/system/zabbix-agent2.service
[Unit]
Description=zabbix_agent2
after=network.target
[Service]
Type=simple
ExecStart=/usr/sbin/zabbix_agent2 -c /etc/zabbix/zabbix_agent2.conf
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable zabbix-agent2
systemctl start zabbix-agent2
windows