Bu bash script Zabbix Agent kurulumu içindir, 1.1.1.1
IP adresini zabbit sunucunuzun IP adresi ile değiştirmeyi unutmayınız.
#!/bin/bash -e
if [ "$UID" -ne 0 ]; then
echo "Please run as root"
exit 1
fi
# Only run it if we can (ie. on RHEL8/CentOS 8)
if [ -x /usr/bin/yum ]; then
yum -y update
rpm -ivh https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-agent-5.0.2-1.el8.x86_64.rpm
yum -y install zabbix-agent
chkconfig zabbix-agent on
sed -i 's/Server=127.0.0.1/Server=1.1.1.1/' /etc/zabbix/zabbix_agentd.conf
sed -i 's/ServerActive=127.0.0.1/ServerActive=1.1.1.1/' /etc/zabbix/zabbix_agentd.conf
HOSTNAME=`hostname` && sed -i "s/Hostname=Zabbix\ server/Hostname=$HOSTNAME/" /etc/zabbix/zabbix_agentd.conf
service zabbix-agent restart
fi