#!/bin/bash#./zabbixagent.sh 172.16.103.16 172.16.103.134#$1 master address, $2 local_listen_ip groupadd zabbix && useradd zabbix -g zabbixcat >>/etc/services<<EOFzabbix-agent 10050/tcp Zabbix Agentzabbix-agent 10050/udp Zabbix Agentzabbix-trapper 10051/tcp Zabbix Trapperzabbix-trapper 10051/udp Zabbix TrapperEOFcp /root/zabbix_agentd /etc/init.d/chmod a+x /etc/init.d/zabbix_agentdcp /root/zabbix_agentd.conf /usr/local/etc/zabbix_agentd.confsed -i "s/Hostname=Zabbix server/Hostname=`hostname`/" /usr/local/etc/zabbix_agentd.confsed -i "s/Server=127.0.0.1/Server=$1/" /usr/local/etc/zabbix_agentd.confsed -i "s/# ListenPort=10050/ListenPort=10050/" /usr/local/etc/zabbix_agentd.confsed -i "s/# ListenIP=0.0.0.0/ListenIP=$2/" /usr/local/etc/zabbix_agentd.confservice iptables stop/etc/init.d/zabbix_agentd startecho "zabbix-agent successful!"
This article is from the "muzinan technical blog" and is not reposted!
Zabbix automatically installs the agent (Shell)