[iyunv@master states]# salt '*' state.highstate
中间步骤略:
----------
ID: zabbix_agent
Function: service.running
Name: zabbix-agent
Result: True
Comment: Service zabbix-agent has been enabled, and is running
Started: 14:04:45.625235
Duration: 410.618 ms
Changes:
----------
zabbix-agent:
True
Summary
------------
Succeeded: 9 (changed=1)
Failed: 0
------------
Total states run: 9
5、在客户端进行测试:
1
2
3
4
5
6
7
8
9
10
[iyunv@master ~]# salt '*' cmd.run '/etc/init.d/zabbix-agentd status'
node01.saltstack.com:
zabbix_agentd (pid 6084) is running...
node02.saltstack.com:
zabbix_agentd (pid 5782) is running...
[iyunv@master ~]# salt '*' cmd.run "egrep -v '^#|^$' /etc/zabbix_agentd.conf|grep -w Server"
node01.saltstack.com:
Server=10.10.10.140
node02.saltstack.com:
Server=10.10.10.140
### Option: ListenPort
#Agent will listen on this port for connections from the server.
----------
Summary
------------
Succeeded: 9 (changed=1)
Failed: 0
------------
Total states run: 9
检查下客户端,看agent的ip地址是否已经调整了:
[iyunv@master ~]# salt '*' cmd.run "egrep -v '^#|^$' /etc/zabbix_agentd.conf|grep -w Server"
node01.saltstack.com:
Server=10.10.10.148
node02.saltstack.com:
Server=10.10.10.148