shell-zabbix-agent


[root@ c7-42 ~]# cat zabbix-agent.sh
#!/bin/bash
cat>>/etc/yum.repos.d/zabbix.repo<<\EOF
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=http://mirrors.aliyun.com/zabbix/zabbix/4.4/rhel/7/$basearch/
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591

[zabbix-debuginfo]
name=Zabbix Official Repository debuginfo - $basearch
baseurl=http://mirrors.aliyun.com/zabbix/zabbix/4.4/rhel/7/$basearch/debuginfo/
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591
gpgcheck=0

[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=http://mirrors.aliyun.com/zabbix/non-supported/rhel/7/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=0
EOF
yum -y install zabbix-agent
sed -i '98s/127.0.0.1/10.0.0.41/' /etc/zabbix/zabbix_agentd.conf
sed -i '139s/127.0.0.1/10.0.0.41/' /etc/zabbix/zabbix_agentd.conf
systemctl enable zabbix-agent
systemctl start zabbix-agent

原创文章 96 获赞 4 访问量 2164

猜你喜欢

转载自blog.csdn.net/weixin_46380571/article/details/105710032