fairyguo 发表于 2018-1-3 19:33:17

saltstack自动化运维系列④之saltstack的命令返回结果mysql数据库写入

mysql> select * from salt_returns\G  

*************************** 1. row ***************************  
fun: test.ping
  
jid:
20170407162451855497  
return: true
  
id: node2.chinasoft.com
  
success: 1
  
full_ret: {"fun_args": [], "jid": "20170407162451855497", "return": true, "retcode": 0, "success": true, "fun": "test.ping", "id": "node2.chinasoft.com"}
  
alter_time: 2017-04-07 16:24:52
  
*************************** 2. row ***************************
  
fun: cmd.run
  
jid: 20170407162553259109
  
return: "Fri Apr 7 16:25:53 CST 2017"
  
id: node2.chinasoft.com
  
success: 1
  
full_ret: {"fun_args": ["date"], "jid": "20170407162553259109", "return": "Fri Apr 7 16:25:53 CST 2017", "retcode": 0, "success": true, "fun": "cmd.run", "id": "node2.chinasoft.com"}
  
alter_time: 2017-04-07 16:25:53
  
*************************** 3. row ***************************
  
fun: cmd.run
  
jid: 20170407162605846972

  
return: "Filesystem Type>  
id: node2.chinasoft.com
  
success: 1

  
full_ret: {"fun_args": ["df -Th"], "jid": "20170407162605846972", "return": "Filesystem Type>  
alter_time: 2017-04-07 16:26:06
  
*************************** 4. row ***************************
  
fun: cmd.run
  
jid: 20170407162611429976
  
return: " total used free shared buffers cached\nMem: 1869 1760 108 0 167 456\n-/+ buffers/cache: 1136 733\nSwap: 3999 35 3964"
  
id: node2.chinasoft.com
  
success: 1
  
full_ret: {"fun_args": ["free -m"], "jid": "20170407162611429976", "return": " total used free shared buffers cached\nMem: 1869 1760 108 0 167 456\n-/+ buffers/cache: 1136 733\nSwap: 3999 35 3964", "retcode": 0, "success": true, "fun": "cmd.run", "id": "node2.chinasoft.com"}
  
alter_time: 2017-04-07 16:26:11
  
4 rows in set (0.00 sec)
页: [1]
查看完整版本: saltstack自动化运维系列④之saltstack的命令返回结果mysql数据库写入