#!/bin/bash

agent_install(){
cd /root/
wget -c http://54.179.201.103:8001/zabbix-agent-3.4.15-1.el7.x86_64.rpm
rpm -ivh /root/zabbix-agent-3.4.15-1.el7.x86_64.rpm
cd /etc/zabbix/ && rm -f zabbix_agentd.conf
cat > /etc/zabbix/zabbix_agentd.conf<<EOF
PidFile=/run/zabbix/zabbix_agentd.pid
LogFile=/var/log/zabbix/zabbix_agentd.log
LogFileSize=0
Server=${Zabbix_Server_Address}
ServerActive=${Zabbix_Server_Address}
Hostname=Zabbix server
Include=/etc/zabbix/zabbix_agentd.d/*.conf
EOF
systemctl start zabbix-agent.service
systemctl status zabbix-agent.service
}
read -e -p "Please input Zabbix_Server IP Address: " Zabbix_Server_Address
agent_install
