NAME="NAME" ZABBIX_SERVER_HOST="HOST"
wget "https://repo.zabbix.com/zabbix/4.4/debian/pool/main/z/zabbix-release/zabbix-release_4.4-1+$(lsb_release -cs)_all.deb" -O /root/zabbix-release_4.4-1+$(lsb_release -cs)_all.deb && dpkg -i /root/zabbix-release_4.4-1+$(lsb_release -cs)_all.deb && apt update && apt -y install zabbix-agent
sed -ie "s/Hostname=Zabbix server/Hostname=${NAME}/g" /etc/zabbix/zabbix_agentd.conf; sed -ie "s/Server=127.0.0.1/Server=${ZABBIX_SERVER_HOST}/g" /etc/zabbix/zabbix_agentd.conf; sed -ie "s/ServerActive=127.0.0.1/ServerActive=${ZABBIX_SERVER_HOST}/g" /etc/zabbix/zabbix_agentd.conf; systemctl restart zabbix-agent
systemctl status zabbix-agent
|