我得到了所有 minions 的第一个有效 json 字符串响应,但随后我又从相同的 minions 得到了另外三个不同的响应,它们是无效的 json 字符串。
root@localhost:/home/i-kod/Desktop/ass1# salt --out json --static '*' test.ping
{
"Pavilion": true,
"I-Kod": true
}
{
"Pavilion": true
}
{
"I-Kod": true
}
{
"neha-HP-Pavilion-15-Notebook-PC": "Minion did not return. [Not connected]"
}
root@localhost:/home/i-kod/Desktop/ass1#
My version information:
root@localhost:/home/i-kod/Desktop/ass1# salt '*' test.versions_report
Pavilion:
Salt: 0.17.5
Python: 2.7.6 (default, Jun 22 2015, 17:58:13)
Jinja2: 2.7.2
M2Crypto: 0.21.1
msgpack-python: 0.3.0
msgpack-pure: Not Installed
pycrypto: 2.6.1
PyYAML: 3.10
PyZMQ: 14.0.1
ZMQ: 4.0.4
I-Kod:
Salt: 2015.5.0
Python: 2.7.9 (default, Apr 2 2015, 15:33:21)
Jinja2: 2.7.3
M2Crypto: 0.21.1
msgpack-python: 0.4.2
msgpack-pure: Not Installed
pycrypto: 2.6.1
libnacl: Not Installed
PyYAML: 3.11
ioflo: Not Installed
PyZMQ: 14.4.1
RAET: Not Installed
ZMQ: 4.0.5
Mako: 1.0.0
Debian source package: 2015.5.0+ds-1utopic1
neha-HP-Pavilion-15-Notebook-PC:
Minion did not return. [Not connected]
root@localhost:/home/i-kod/Desktop/ass1#
我只想要有效的 json 字符串。
答案1
检查您是否有多个 minion 进程正在运行。/etc/init.d/salt-minion stop
并且pgrep salt-minion
应该不返回任何内容。