Zabbix automatically installs the agent (Shell)

Source: Internet
Author: User
#!/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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.