1、基于ubuntu一键安装zabbix agent脚本
#!/bin/bash
SERVER_IP=10.0.0.100
wget https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-1+focal_all.deb
dpkg -i zabbix-release_5.0-1+focal_all.deb
sed -i.bak 's#http://repo.zabbix.com#https://mirrors.tuna.tsinghua.edu.cn/zabbix#' /etc/apt/sources.list.d/zabbix.list
apt update
apt install zabbix-agent2 -y
sed -i.bak '/^Server=/c Server=$SERVER_IP' /etc/zabbix/zabbix_agent2.conf
systemctl restart zabbix-agent2.service
2、通用centos/rocky,ubuntu一键安装zabbix agent脚本
#!/bin/bash
ZABBIX_SERVER=zabbix.wang.org
ZABBIX_VER=5.0
URL="https://mirror.tuna.tsinghua.edu.cn/zabbix"
. /etc/os-release
color () {
RES_COL=60
MOVE_TO_COL="echo -en \\033[${RES_COL}G"
SETCOLOR_SUCCESS="echo -en \\033[1;32m"
SETCOLOR_FAILURE="echo -en \\033[1;31m"
SETCOLOR_WARNING="echo -en \\033[1;33m"
SETCOLOR_NORMAL="echo -en \E[0m"
echo -n "$1" && $MOVE_TO_COL
echo -n "["
if [ $2 = "success" -o $2 = "0" ] ;then