您好,登錄后才能下訂單哦!
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"
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。