rocky linux 9部署zabbix7

2024-07-01

CentOS 8 的对应版本是 Rocky Linux 8。CentOS 9 的对应版本是 Rocky Linux 9。

cat /etc/rocky-release

1、允许root登录
CentOS Stream 9 / Rocky Linux 9系列系统在OS内部的crypto-policies策略默认为DEFAULT,
在该策略模式下openssh-server禁用了ssh-rsa(rsa/SHA1)签名算法。
update-crypto-policies --set LEGACY
update-crypto-policies --show

##############
2、Rocky Linux 9.4 部署Zabbix 7.0

rpm -Uvh https://repo.zabbix.com/zabbix/7.0/rocky/9/x86_64/zabbix-release-7.0-2.el9.noarch.rpm && yum clean all
dnf -y install https://repo.zabbix.com/zabbix/6.4/rhel/8/x86_64/zabbix-release-6.4-1.el8.noarch.rpm
rpm -Uvh https://mirrors.aliyun.com/zabbix/zabbix/7.0/rhel/8/x86_64/zabbix-release-7.0-2.el8.noarch.rpm

sed -i 's/repo.zabbix.com/mirrors.aliyun.com\/zabbix/g' /etc/yum.repos.d/zabbix.repo
yum install zabbix-server-mysql zabbix-web-mysql zabbix-nginx-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent -y
php8.0

3、导入数据
create database zabbix character set utf8mb4 collate utf8mb4_bin;
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix

gzip -d /usr/share/zabbix-sql-scripts/mysql/server.sql.gz
mysql -u zabbix -D zabbix < server.sql

4、linux安装zabbix-agent2
#!/bin/sh
#yum -y install https://repo.zabbix.com/zabbix/7.0/rocky/8/x86_64/zabbix-release-7.0-2.el8.noarch.rpm
&& yum clean all
#sed -i 's/repo.zabbix.com/mirrors.aliyun.com\/zabbix/g' /etc/yum.repos.d/zabbix.repo
#yum -y install zabbix-agent2.x86_64
##yum -y install http://www.easyliao.com/tar/zabbix-agent2-6.2.0-1.el7.x86_64.rpm
#yum -y install http://www.easyliao.com/tar/zabbix-agent2-6.4.1-release1.el8.x86_64.rpm
#yum -y install http://repo.zabbix.com/zabbix/6.4/rhel/8/x86_64/zabbix-agent2-6.4.1-release1.el8.x86_64.rpm
yum -y install https://mirrors.aliyun.com/zabbix/zabbix/7.0/rhel/8/x86_64/zabbix-agent2-7.0.0-release1.el8.x86_64.rpm
IP=$(ifconfig eth0|grep inet|awk '{print $2}'|head -1)
HNAME=$(hostname)
HNAME=bj-mongo
Zserver=172.21.72.81
cat > /etc/zabbix/zabbix_agent2.conf << EOF
PidFile=/run/zabbix/zabbix_agent2.pid
LogFile=/var/log/zabbix/zabbix_agent2.log
LogFileSize=0
Server=${Zserver}
ServerActive=${Zserver}
Hostname=${HNAME}-${IP}
EOF

systemctl stop zabbix-agent
yum -y remove zabbix-agent
systemctl enable zabbix-agent2
systemctl restart zabbix-agent2

grep Hostname /etc/zabbix/zabbix_agent2.conf

5、windows安装zabbix-agent2
https://www.zabbix.com/cn/download_agents?version=7.0+LTS&release=7.0.0&os=Windows&os_version=Any&hardware=amd64&encryption=OpenSSL&packaging=MSI&show_legacy=0

https://cdn.zabbix.com/zabbix/binaries/stable/7.0/7.0.0/zabbix_agent2-7.0.0-windows-amd64-openssl.msi
https://cdn.zabbix.com/zabbix/binaries/stable/7.0/7.0.0/zabbix_agent-7.0.0-windows-amd64-openssl.msi

zabbix Agent 2 is written in Go programming language (with some C code of Zabbix agent reused).

分类:操作系统 | 标签: |

相关日志

评论被关闭!