# Run the server in a container: https://github.com/zabbix/zabbix-docker

# This installs zabbix-agent
# zabbix does ship woth debian but has been removed from testing, it is in stable and unstable.
# Current version of the zabbix-agent should probably be distributed by salt for platforms
# needed and for the version of zabbix server being run.

UPSTREAM_VERSION=$(lastversion zabbix)
ZABBIX_VERSION="${UPSTREAM_VERSION::-2}"

# RELEASE_NAME="bookworm"  # stetch buster bullseye bookworm
RELEASE_NUMBER=12        # 9      10     11       12

# cat <<-EOF | sudo tee /etc/apt/sources.list-available/zabbix.list
#	# Zabbix main repository
#	deb https://repo.zabbix.com/zabbix/${ZABBIX_VERSION}/debian ${RELEASE_NAME} main
#	deb-src https://repo.zabbix.com/zabbix/${ZABBIX_VERSION}/debian ${RELEASE_NAME} main
#
#	# Zabbix unstable repository
#	#deb https://repo.zabbix.com/zabbix/${ZABBIX_VERSION}/debian ${RELEASE_NAME} main
#	#deb-src https://repo.zabbix.com/zabbix/${ZABBIX_VERSION}/debian ${RELEASE_NAME} main
# EOF
#
#
# ln -sf /etc/apt/sources.list-available/zabbix.list /etc/apt/sources.list.d/zabbix.list

wget -c --directory-prefix=/tmp https://repo.zabbix.com/zabbix/${ZABBIX_VERSION}/debian/pool/main/z/zabbix-release/zabbix-release_${ZABBIX_VERSION}-1+debian${RELEASE_NUMBER}_all.deb

sudo dpkg -i /tmp/zabbix-release_${ZABBIX_VERSION}-1+debian${RELEASE_NUMBER}_all.deb

sudo apt-get update

sudo apt install zabbix-agent


