ansible安装配置zabbix客户端



安装软件

ansible host -m apt -a "name=zabbix-agent state=present"

ansible host -m shell -a "/sbin/ifconfig"

备份配置文件

ansible host -m shell -a "/bin/cp /etc/zabbix/zabbix_agentd.conf /etc/zabbix/zabbix_agentd.conf.bak"

查看更新会影响到的条数:

ansible host -m shell -a "/bin/cat /etc/zabbix/zabbix_agentd.conf|/bin/grep Server=127.0.0.1"

更新配置

ansible host -m shell -a "/bin/sed -i 's/Server=127.0.0.1/Server=10.8.0.231/g' /etc/zabbix/zabbix_agentd.conf "

重启服务

ansible host -m service -a "name=zabbix-agent state=restarted"


上一篇:RS查询报错之递归公用表表达式不包含* UNION ALL运算符


下一篇:solidworks基础-装配那些事