Updated again, OS is EOL
This commit is contained in:
@@ -65,7 +65,7 @@ install_agent_package_manager() {
|
||||
dpkg_arch=$(dpkg --print-architecture)
|
||||
|
||||
# Zabbix provides separate repos for ARM architectures:
|
||||
# - debian-arm64 / ubuntu-arm64 for aarch64
|
||||
# - debian-arm64 / ubuntu-arm64 for aarch64 (Bookworm/Trixie+ only)
|
||||
# - raspbian for armhf (Raspberry Pi OS)
|
||||
# The standard debian/ubuntu repos only carry amd64.
|
||||
local repo_distro=""
|
||||
@@ -98,6 +98,17 @@ install_agent_package_manager() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
# The arm64 Zabbix repos only support Debian 12+ (bookworm, trixie).
|
||||
# For older/EOL releases like bullseye, skip directly to binary install.
|
||||
case "${codename}" in
|
||||
buster|bullseye|stretch|jessie)
|
||||
log "Zabbix arm64 apt repo not available for EOL release '${codename}'."
|
||||
log "Falling back to binary tarball..."
|
||||
install_agent_binary
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
# Disable defunct backports repos to prevent apt-get update 404 errors (Debian EOL releases)
|
||||
local backports_list
|
||||
backports_list=$(grep -rl 'backports' /etc/apt/sources.list /etc/apt/sources.list.d/ 2>/dev/null || true)
|
||||
@@ -109,15 +120,23 @@ install_agent_package_manager() {
|
||||
fi
|
||||
|
||||
# Download and install the Zabbix release package for the ARM-specific repo
|
||||
local release_url="https://repo.zabbix.com/zabbix/7.0/${repo_distro}/pool/main/z/zabbix-release/zabbix-release_latest+${OS_ID}${OS_VERSION}_all.deb"
|
||||
local release_url="https://repo.zabbix.com/zabbix/7.0/${repo_distro}/pool/main/z/zabbix-release/zabbix-release_latest_7.0+${OS_ID}${OS_VERSION}_all.deb"
|
||||
log "Adding Zabbix repository: ${repo_distro} (${codename})"
|
||||
log "Release package URL: ${release_url}"
|
||||
|
||||
if wget -q "${release_url}" -O /tmp/zabbix-release.deb 2>/dev/null || \
|
||||
curl -sL "${release_url}" -o /tmp/zabbix-release.deb 2>/dev/null; then
|
||||
curl -sfL "${release_url}" -o /tmp/zabbix-release.deb 2>/dev/null; then
|
||||
|
||||
# Verify we actually got a .deb and not an error page
|
||||
if ! dpkg-deb --info /tmp/zabbix-release.deb >/dev/null 2>&1; then
|
||||
log "Downloaded file is not a valid .deb package. Falling back to binary..."
|
||||
rm -f /tmp/zabbix-release.deb
|
||||
install_agent_binary
|
||||
return 0
|
||||
fi
|
||||
|
||||
dpkg -i /tmp/zabbix-release.deb
|
||||
apt-get update -o Acquire::AllowInsecureRepositories=false 2>&1 | grep -v "^W:" || true
|
||||
apt-get update
|
||||
if apt-get install -y zabbix-agent2; then
|
||||
rm -f /tmp/zabbix-release.deb
|
||||
log "Package installation successful."
|
||||
|
||||
Reference in New Issue
Block a user