资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

ansible批量安装zabbix-agent

centos7.x 

网站建设哪家好,找成都创新互联!专注于网页设计、网站建设、微信开发、小程序定制开发、集团企业网站建设等服务项目。为回馈新老客户创新互联还提供了南平免费建站欢迎大家使用!

ansible -i add_zabbix_list zabbix -s -m shell -a "rpm -iUh http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-agent-4.0.1-1.el7.x86_64.rpm"

<--

如果无法在线安装rpm包就分发过去

ansible -i add_zabbix_list zabbix -s -m shell -a "mkdir /data/tools"

ansible -i add_zabbix_list zabbix -s -m copy -a "src=/data/tools/zabbix-agent-4.0.1-1.el7.x86_64.rpm dest=/data/tools"

ansible -i add_zabbix_list zabbix -s -m shell -a "rpm -ivh /data/tools/zabbix-agent-4.0.1-1.el7.x86_64.rpm"

-->

ansible -i add_zabbix_list zabbix -s -m shell -a "ls -la /etc/zabbix"

ansible -i add_zabbix_list zabbix -s -m copy -a "src=/etc/zabbix dest=/etc owner=root group=root mode=0755"

ansible -i add_zabbix_list zabbix -s -m shell -a "sed -i '/Hostname/s/^/#/g' /etc/zabbix/zabbix_agentd.conf"

ansible -i add_zabbix_list zabbix -s -m shell -a 'echo "Hostname=`hostname`" >> /etc/zabbix/zabbix_agentd.conf'

ansible -i add_zabbix_list zabbix -s -m file -a "path=/data/zabbixdata state=directory recurse=yes owner=zabbix group=zabbix"

ansible -i add_zabbix_list zabbix -s -m systemd -a "name=zabbix-agent state=started"

ansible -i add_zabbix_list zabbix -s -m systemd -a "name=zabbix-agent state=started enabled=true"

ansible -i add_zabbix_list zabbix -s -m shell -a "cat /etc/zabbix/zabbix_agentd.conf"

ansible -i add_zabbix_list zabbix -s -m shell -a "netstat -lntup|grep 10050"


centos6.x

ansible -i t3_test_list test -s -m shell -a "rpm -iUh https://repo.zabbix.com/zabbix/4.0/rhel/6/x86_64/zabbix-agent-4.0.1-1.el6.x86_64.rpm"

ansible -i t3_test_list test -s -m shell -a "rpm -qa |grep zabbix"

ansible -i t3_test_list test -s -m shell -a "ls -la /etc/zabbix"

ansible -i t3_test_list test -s -m unarchive -a "src=/data/scripts/iplistfile/zabbix.tar.gz dest=/etc/ owner=root group=root"

ansible -i t3_test_list test -s -m service -a "name=zabbix-agent state=started enabled=true"

ansible -i t3_test_list test -s -m shell -a "service zabbix-agent stop"

ansible -i t3_test_list test -s -m shell -a "sed -i '/Hostname/s/^/#/g' /etc/zabbix/zabbix_agentd.conf"

ansible -i t3_test_list test -s -m shell -a 'echo "Hostname=`hostname`" >> /etc/zabbix/zabbix_agentd.conf'

ansible -i t3_test_list test -s -m file -a "path=/data/zabbixdata state=directory recurse=yes owner=zabbix group=zabbix"

ansible -i t3_test_list test -s -m service -a "name=zabbix-agent state=started"

ansible -i t3_test_list test -s -m shell -a "netstat -lntup|grep 10050"


文章标题:ansible批量安装zabbix-agent
分享路径:http://cdkjz.cn/article/ipchdi.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220