1 Server-proxy 数据交换协议

概述

Server-proxy 数据交换基于JSON格式。

请求和响应消息必须以header and data length开头

被动代理

代理配置请求

proxy config 请求由服务器发送以提供代理配置数据。 每次发送此请求 ProxyConfigFrequency (服务器配置参数)秒。

namevalue typedescription
server→proxy:
requeststring‘proxy config’
<table>objectone or more objects with <table> data
fieldsarrayarray of field names
-stringfield name
dataarrayarray of rows
-arrayarray of columns
-string,numbercolumn value with type depending on column type in database schema
proxy→server:
responsestringthe request success information (‘success’ or ‘failed’)
versionstringthe proxy version (<major>.<minor>.<build>)

例:

server→proxy:

  1. {
  2. "request": "proxy config",
  3. "globalmacro":{
  4. "fields":[
  5. "globalmacroid",
  6. "macro",
  7. "value"
  8. ],
  9. "data":[
  10. [
  11. 2,
  12. "{$SNMP_COMMUNITY}",
  13. "public"
  14. ]
  15. ]
  16. },
  17. "hosts":{
  18. "fields":[
  19. "hostid",
  20. "host",
  21. "status",
  22. "ipmi_authtype",
  23. "ipmi_privilege",
  24. "ipmi_username",
  25. "ipmi_password",
  26. "name",
  27. "tls_connect",
  28. "tls_accept",
  29. "tls_issuer",
  30. "tls_subject",
  31. "tls_psk_identity",
  32. "tls_psk"
  33. ],
  34. "data":[
  35. [
  36. 10001,
  37. "Template OS Linux",
  38. 3,
  39. -1,
  40. 2,
  41. "",
  42. "",
  43. "Template OS Linux",
  44. 1,
  45. 1,
  46. "",
  47. "",
  48. "",
  49. ""
  50. ],
  51. [
  52. 10050,
  53. "Template App Zabbix Agent",
  54. 3,
  55. -1,
  56. 2,
  57. "",
  58. "",
  59. "Template App Zabbix Agent",
  60. 1,
  61. 1,
  62. "",
  63. "",
  64. "",
  65. ""
  66. ],
  67. [
  68. 10105,
  69. "Logger",
  70. 0,
  71. -1,
  72. 2,
  73. "",
  74. "",
  75. "Logger",
  76. 1,
  77. 1,
  78. "",
  79. "",
  80. "",
  81. ""
  82. ]
  83. ]
  84. },
  85. "interface":{
  86. "fields":[
  87. "interfaceid",
  88. "hostid",
  89. "main",
  90. "type",
  91. "useip",
  92. "ip",
  93. "dns",
  94. "port",
  95. "bulk"
  96. ],
  97. "data":[
  98. [
  99. 2,
  100. 10105,
  101. 1,
  102. 1,
  103. 1,
  104. "127.0.0.1",
  105. "",
  106. "10050",
  107. 1
  108. ]
  109. ]
  110. },
  111. ...
  112. }

proxy→server:

  1. {
  2. "response": "success",
  3. "version": "5.0.0"
  4. }
代理请求

proxy data request用于从代理获取主机可用性,历史,发现和自动注册数据。 每次发送此请求 ProxyDataFrequency (服务器配置参数)秒。

namevalue typedescription
server→proxy:
requeststring‘proxy data’
proxy→server:
host availabilityarray(optional) array of host availability data objects
hostidnumberhost identifier
availablenumberZabbix agent availability

0, HOSTAVAILABLE_UNKNOWN - unknown
1, HOST_AVAILABLE_TRUE - available
2, HOST_AVAILABLE_FALSE - unavailable
errorstringZabbix agent error message or empty string
snmp_availablenumberSNMP agent availability

0, HOST_AVAILABLE_UNKNOWN - unknown
1, HOST_AVAILABLE_TRUE - available
2, HOST_AVAILABLE_FALSE - unavailable
snmp_errorstringSNMP agent error message or empty string
ipmi_availablenumberIPMI agent availability

0, HOST_AVAILABLE_UNKNOWN - unknown
1, HOST_AVAILABLE_TRUE - available
2, HOST_AVAILABLE_FALSE - unavailable
ipmi_errorstringIPMI agent error message or empty string
jmx_availablenumberJMX agent availability

0, HOST_AVAILABLE_UNKNOWN - unknown
1, HOST_AVAILABLE_TRUE - available
2, HOST_AVAILABLE_FALSE - unavailable
jmx_errorstringJMX agent error message or empty string
history dataarray(optional) array of history data objects
itemidnumberitem identifier
clocknumberitem value timestamp (seconds)
nsnumberitem value timestamp (nanoseconds)
valuestring(optional) item value
timestampnumber(optional) timestamp of log type items
sourcestring(optional) eventlog item source value
severitynumber(optional) eventlog item severity value
eventidnumber(optional) eventlog item eventid value
statestring(optional) item state
0, ITEM_STATE_NORMAL
1, ITEM_STATE_NOTSUPPORTED
lastlogsizenumber(optional) last logs ize of log type items
mtimenumber(optional) modify time of log type items
discovery dataarray(optional) array of discovery data objects
clocknumberthe discovery data timestamp
druleidnumberthe discovery rule identifier
dcheckidnumberthe discovery check indentifier or null for discovery rule data
typenumberthe discovery check type:

-1 discovery rule data
0, SVC_SSH - SSH service check
1, SVC_LDAP - LDAP service check
2, SVC_SMTP - SMTP service check
3, SVCFTP - FTP service check
4, SVCHTTP - HTTP service check
5, SVC_POP - POP service check
6, SVC_NNTP - NNTP service check
7, SVC_IMAP - IMAP service check
8, SVC_TCP - TCP port availability check
9, SVC_AGENT - Zabbix agent
10, SVC_SNMPv1 - SNMPv1 agent
11, SVC_SNMPv2 - SNMPv2 agent
12, SVC_ICMPPING - ICMP ping
13, SVC_SNMPv3 - SNMPv3 agent
14, SVC_HTTPS - HTTPS service check
15, SVC_TELNET - Telnet availability check
ipstringthe host IP address
dnsstringthe host DNS name
portnumber(optional) service port number
keystring(optional) the item key for discovery check of type 9 SVC_AGENT
valuestring(optional) value received from the service, can be empty for most of services
statusnumber(optional) service status:

0, DOBJECT_STATUS_UP - Service UP
1, DOBJECT_STATUS_DOWN - Service DOWN
auto registrationarray(optional) array of auto registration data objects
clocknumberthe auto registration data timestamp
hoststringthe host name
ipstring(optional) the host IP address
dnsstring(optional) the resolved DNS name from IP address
portstring(optional) the host port
host_metadatastring(optional) the host metadata sent by agent (based on HostMetadata or HostMetadataItem agent configuration parameter)
tasksarray(optional) array of tasks
typenumberthe task type:

0, ZBX_TM_TASK_PROCESS_REMOTE_COMMAND_RESULT - remote command result
statusnumberthe remote command execution status:

0, ZBX_TM_REMOTE_COMMAND_COMPLETED - the remote command completed successfully
1, ZBX_TM_REMOTE_COMMAND_FAILED - the remote command failed
errorstring(optional) the error message
parent_taskidnumberthe parent task id
morenumber(optional) 1 - there are more history data to send
clocknumberdata transfer timestamp (seconds)
nsnumberdata transfer timestamp (nanoseconds)
versionstringthe proxy version (<major>.<minor>.<build>)
server→proxy:
responsestringthe request success information (‘success’ or ‘failed’)
tasksarray(optional) array of tasks
typenumberthe task type:

1, ZBX_TM_TASK_PROCESS_REMOTE_COMMAND - remote command
clocknumberthe task creation time
ttlnumberthe time in seconds after which task expires
commandtypenumberthe remote command type:

0, ZBX_SCRIPT_TYPE_CUSTOM_SCRIPT - use custom script
1, ZBX_SCRIPT_TYPE_IPMI - use IPMI
2, ZBX_SCRIPT_TYPE_SSH - use SSH
3, ZBX_SCRIPT_TYPE_TELNET - use Telnet
4, ZBX_SCRIPT_TYPE_GLOBAL_SCRIPT - use global script (currently functionally equivalent to custom script)
commandstringthe remote command to execute
execute_onnumberthe execution target for custom scripts:

0, ZBX_SCRIPT_EXECUTE_ON_AGENT - execute script on agent
1, ZBX_SCRIPT_EXECUTE_ON_SERVER - execute script on server
2, ZBX_SCRIPT_EXECUTE_ON_PROXY - execute script on proxy
portnumber(optional) the port for telnet and ssh commands
authtypenumber(optional) the authentication type for ssh commands
usernamestring(optional) the user name for telnet and ssh commands
passwordstring(optional) the password for telnet and ssh commands
publickeystring(optional) the public key for ssh commands
privatekeystring(optional) the private key for ssh commands
parent_taskidnumberthe parent task id
hostidnumbertarget hostid

例如:

server→proxy:

  1. {
  2. "request": "proxy data"
  3. }

proxy→server:

  1. {
  2. "host availability":[
  3. {
  4. "hostid":10106,
  5. "available":1,
  6. "error":"",
  7. "snmp_available":0,
  8. "snmp_error":"",
  9. "ipmi_available":0,
  10. "ipmi_error":"",
  11. "jmx_available":0,
  12. "jmx_error":""
  13. },
  14. {
  15. "hostid":10107,
  16. "available":1,
  17. "error":"",
  18. "snmp_available":0,
  19. "snmp_error":"",
  20. "ipmi_available":0,
  21. "ipmi_error":"",
  22. "jmx_available":0,
  23. "jmx_error":""
  24. }
  25. ],
  26. "history data":[
  27. {
  28. "itemid":"12345",
  29. "clock":1478609647,
  30. "ns":332510044,
  31. "value":"52956612"
  32. },
  33. {
  34. "itemid":"12346",
  35. "clock":1478609647,
  36. "ns":330690279,
  37. "state":1,
  38. "value":"Cannot find information for this network interface in /proc/net/dev."
  39. }
  40. ],
  41. "discovery data":[
  42. {
  43. "clock":1478608764,
  44. "drule":2,
  45. "dcheck":3,
  46. "type":12,
  47. "ip":"10.3.0.10",
  48. "dns":"vdebian",
  49. "status":1
  50. },
  51. {
  52. "clock":1478608764,
  53. "drule":2,
  54. "dcheck":null,
  55. "type":-1,
  56. "ip":"10.3.0.10",
  57. "dns":"vdebian",
  58. "status":1
  59. }
  60. ],
  61. "auto registration":[
  62. {
  63. "clock":1478608371,
  64. "host":"Logger1",
  65. "ip":"10.3.0.1",
  66. "dns":"localhost",
  67. "port":"10050"
  68. },
  69. {
  70. "clock":1478608381,
  71. "host":"Logger2",
  72. "ip":"10.3.0.2",
  73. "dns":"localhost",
  74. "port":"10050"
  75. }
  76. ],
  77. "tasks":[
  78. {
  79. "type": 0,
  80. "status": 0,
  81. "parent_taskid": 10
  82. },
  83. {
  84. "type": 0,
  85. "status": 1,
  86. "error": "No permissions to execute task.",
  87. "parent_taskid": 20
  88. }
  89. ],
  90. "version":"5.0.0"
  91. }

server→proxy:

  1. {
  2. "response": "success",
  3. "tasks":[
  4. {
  5. "type": 1,
  6. "clock": 1478608371,
  7. "ttl": 600,
  8. "commandtype": 2,
  9. "command": "restart_service1.sh",
  10. "execute_on": 2,
  11. "port": 80,
  12. "authtype": 0,
  13. "username": "userA",
  14. "password": "password1",
  15. "publickey": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqGKukO1De7zhZj6+H0qtjTkVxwTCpvKe",
  16. "privatekey": "lsuusFncCzWBQ7RKNUSesmQRMSGkVb1/3j+skZ6UtW+5u09lHNsj6tQ5QCqGKukO1De7zhd",
  17. "parent_taskid": 10,
  18. "hostid": 10070
  19. },
  20. {
  21. "type": 1,
  22. "clock": 1478608381,
  23. "ttl": 600,
  24. "commandtype": 1,
  25. "command": "restart_service2.sh",
  26. "execute_on": 0,
  27. "authtype": 0,
  28. "username": "",
  29. "password": "",
  30. "publickey": "",
  31. "privatekey": "",
  32. "parent_taskid": 20,
  33. "hostid": 10084
  34. }
  35. ]
  36. }

主动代理

代理心跳请求

proxy heartbeat 请求由代理发送以报告代理正在运行。 每次发送此请求 HeartbeatFrequency (代理配置参数)秒。

namevalue typedescription
proxy→server:
requeststring‘proxy heartbeat’
hoststringthe proxy name
versionstringthe proxy version (<major>.<minor>.<build>)
server→proxy:
responsestringthe request success information (‘success’ or ‘failed’)

proxy→server:

  1. {
  2. "request": "proxy heartbeat",
  3. "host": "Proxy #12",
  4. "version": "5.0.0"
  5. }

server→proxy:

  1. {
  2. "response": "success"
  3. }
代理配置请求

proxy config 请求由代理发送以获取代理配置数据。 每次发送此请求 ConfigFrequency (代理配置参数)秒。

namevalue typedescription
proxy→server:
requeststring‘proxy config’
hoststringproxy name
versionstringthe proxy version (<major>.<minor>.<build>)
server→proxy:
requeststring‘proxy config’
<table>objectone or more objects with <table> data
fieldsarrayarray of field names
-stringfield name
dataarrayarray of rows
-arrayarray of columns
-string,numbercolumn value with type depending on column type in database schema
proxy→server:
responsestringthe request success information (‘success’ or ‘failed’)

例如:

proxy→server:

  1. {
  2. "request": "proxy config",
  3. "host": "Proxy #12",
  4. "version":"5.0.0"
  5. }

server→proxy:

  1. {
  2. "globalmacro":{
  3. "fields":[
  4. "globalmacroid",
  5. "macro",
  6. "value"
  7. ],
  8. "data":[
  9. [
  10. 2,
  11. "{$SNMP_COMMUNITY}",
  12. "public"
  13. ]
  14. ]
  15. },
  16. "hosts":{
  17. "fields":[
  18. "hostid",
  19. "host",
  20. "status",
  21. "ipmi_authtype",
  22. "ipmi_privilege",
  23. "ipmi_username",
  24. "ipmi_password",
  25. "name",
  26. "tls_connect",
  27. "tls_accept",
  28. "tls_issuer",
  29. "tls_subject",
  30. "tls_psk_identity",
  31. "tls_psk"
  32. ],
  33. "data":[
  34. [
  35. 10001,
  36. "Template OS Linux",
  37. 3,
  38. -1,
  39. 2,
  40. "",
  41. "",
  42. "Template OS Linux",
  43. 1,
  44. 1,
  45. "",
  46. "",
  47. "",
  48. ""
  49. ],
  50. [
  51. 10050,
  52. "Template App Zabbix Agent",
  53. 3,
  54. -1,
  55. 2,
  56. "",
  57. "",
  58. "Template App Zabbix Agent",
  59. 1,
  60. 1,
  61. "",
  62. "",
  63. "",
  64. ""
  65. ],
  66. [
  67. 10105,
  68. "Logger",
  69. 0,
  70. -1,
  71. 2,
  72. "",
  73. "",
  74. "Logger",
  75. 1,
  76. 1,
  77. "",
  78. "",
  79. "",
  80. ""
  81. ]
  82. ]
  83. },
  84. "interface":{
  85. "fields":[
  86. "interfaceid",
  87. "hostid",
  88. "main",
  89. "type",
  90. "useip",
  91. "ip",
  92. "dns",
  93. "port",
  94. "bulk"
  95. ],
  96. "data":[
  97. [
  98. 2,
  99. 10105,
  100. 1,
  101. 1,
  102. 1,
  103. "127.0.0.1",
  104. "",
  105. "10050",
  106. 1
  107. ]
  108. ]
  109. },
  110. ...
  111. }

proxy→server:

  1. {
  2. "response": "success"
  3. }
代理数据请求

proxy data 请求由代理发送,以提供主机可用性,历史记录,发现和自动注册数据。 每次发送此请求 DataSenderFrequency (代理配置参数)秒。

namevalue typedescription
proxy→server:
requeststring‘proxy data’
hoststringthe proxy name
host availabilityarray(optional) array of host availability data objects
hostidnumberhost identifier
availablenumberZabbix agent availability

0, HOSTAVAILABLE_UNKNOWN - unknown
1, HOST_AVAILABLE_TRUE - available
2, HOST_AVAILABLE_FALSE - unavailable
errorstringZabbix agent error message or empty string
snmp_availablenumberSNMP agent availability

0, HOST_AVAILABLE_UNKNOWN - unknown
1, HOST_AVAILABLE_TRUE - available
2, HOST_AVAILABLE_FALSE - unavailable
snmp_errorstringSNMP agent error message or empty string
ipmi_availablenumberIPMI agent availability

0, HOST_AVAILABLE_UNKNOWN - unknown
1, HOST_AVAILABLE_TRUE - available
2, HOST_AVAILABLE_FALSE - unavailable
ipmi_errorstringIPMI agent error message or empty string
jmx_availablenumberJMX agent availability

0, HOST_AVAILABLE_UNKNOWN - unknown
1, HOST_AVAILABLE_TRUE - available
2, HOST_AVAILABLE_FALSE - unavailable
jmx_errorstringJMX agent error message or empty string
history dataarray(optional) array of history data objects
itemidnumberitem identifier
clocknumberitem value timestamp (seconds)
nsnumberitem value timestamp (nanoseconds)
valuestring(optional) item value
timestampnumber(optional) timestamp of log type items
sourcestring(optional) eventlog item source value
severitynumber(optional) eventlog item severity value
eventidnumber(optional) eventlog item eventid value
statestring(optional) item state
0, ITEM_STATE_NORMAL
1, ITEM_STATE_NOTSUPPORTED
lastlogsizenumber(optional) last logs ize of log type items
mtimenumber(optional) modify time of log type items
discovery dataarray(optional) array of discovery data objects
clocknumberthe discovery data timestamp
druleidnumberthe discovery rule identifier
dcheckidnumberthe discovery check indentifier or null for discovery rule data
typenumberthe discovery check type:

-1 discovery rule data
0, SVC_SSH - SSH service check
1, SVC_LDAP - LDAP service check
2, SVC_SMTP - SMTP service check
3, SVCFTP - FTP service check
4, SVCHTTP - HTTP service check
5, SVC_POP - POP service check
6, SVC_NNTP - NNTP service check
7, SVC_IMAP - IMAP service check
8, SVC_TCP - TCP port availability check
9, SVC_AGENT - Zabbix agent
10, SVC_SNMPv1 - SNMPv1 agent
11, SVC_SNMPv2 - SNMPv2 agent
12, SVC_ICMPPING - ICMP ping
13, SVC_SNMPv3 - SNMPv3 agent
14, SVC_HTTPS - HTTPS service check
15, SVC_TELNET - Telnet availability check
ipstringthe host IP address
dnsstringthe host DNS name
portnumber(optional) service port number
keystring(optional) the item key for discovery check of type 9 SVC_AGENT
valuestring(optional) value received from the service, can be empty for most of services
statusnumber(optional) service status:

0, DOBJECT_STATUS_UP - Service UP
1, DOBJECT_STATUS_DOWN - Service DOWN
auto registrationarray(optional) array of auto registration data objects
clocknumberthe auto registration data timestamp
hoststringthe host name
ipstring(optional) the host IP address
dnsstring(optional) the resolved DNS name from IP address
portstring(optional) the host port
host_metadatastring(optional) the host metadata sent by agent (based on HostMetadata or HostMetadataItem agent configuration parameter)
tasksarray(optional) array of tasks
typenumberthe task type:

0, ZBX_TM_TASK_PROCESS_REMOTE_COMMAND_RESULT - remote command result
statusnumberthe remote command execution status:

0, ZBX_TM_REMOTE_COMMAND_COMPLETED - the remote command completed successfully
1, ZBX_TM_REMOTE_COMMAND_FAILED - the remote command failed
errorstring(optional) the error message
parent_taskidnumberthe parent task id
morenumber(optional) 1 - there are more history data to send
clocknumberdata transfer timestamp (seconds)
nsnumberdata transfer timestamp (nanoseconds)
versionstringthe proxy version (<major>.<minor>.<build>)
server→proxy:
responsestringthe request success information (‘success’ or ‘failed’)
tasksarray(optional) array of tasks
typenumberthe task type:

1, ZBX_TM_TASK_PROCESS_REMOTE_COMMAND - remote command
clocknumberthe task creation time
ttlnumberthe time in seconds after which task expires
commandtypenumberthe remote command type:

0, ZBX_SCRIPT_TYPE_CUSTOM_SCRIPT - use custom script
1, ZBX_SCRIPT_TYPE_IPMI - use IPMI
2, ZBX_SCRIPT_TYPE_SSH - use SSH
3, ZBX_SCRIPT_TYPE_TELNET - use Telnet
4, ZBX_SCRIPT_TYPE_GLOBAL_SCRIPT - use global script (currently functionally equivalent to custom script)
commandstringthe remote command to execute
execute_onnumberthe execution target for custom scripts:

0, ZBX_SCRIPT_EXECUTE_ON_AGENT - execute script on agent
1, ZBX_SCRIPT_EXECUTE_ON_SERVER - execute script on server
2, ZBX_SCRIPT_EXECUTE_ON_PROXY - execute script on proxy
portnumber(optional) the port for telnet and ssh commands
authtypenumber(optional) the authentication type for ssh commands
usernamestring(optional) the user name for telnet and ssh commands
passwordstring(optional) the password for telnet and ssh commands
publickeystring(optional) the public key for ssh commands
privatekeystring(optional) the private key for ssh commands
parent_taskidnumberthe parent task id
hostidnumbertarget hostid

例如:

proxy→server:

  1. {
  2. "request": "proxy data",
  3. "host": "Proxy #12",
  4. "session": "12345678901234567890123456789012",
  5. "host availability":[
  6. {
  7. "hostid":10106,
  8. "available":1,
  9. "error":"",
  10. "snmp_available":0,
  11. "snmp_error":"",
  12. "ipmi_available":0,
  13. "ipmi_error":"",
  14. "jmx_available":0,
  15. "jmx_error":""
  16. },
  17. {
  18. "hostid":10107,
  19. "available":1,
  20. "error":"",
  21. "snmp_available":0,
  22. "snmp_error":"",
  23. "ipmi_available":0,
  24. "ipmi_error":"",
  25. "jmx_available":0,
  26. "jmx_error":""
  27. }
  28. ],
  29. "history data":[
  30. {
  31. "itemid":"12345",
  32. "clock":1478609647,
  33. "ns":332510044,
  34. "value":"52956612"
  35. "id": 1
  36. },
  37. {
  38. "itemid":"12346",
  39. "clock":1478609647,
  40. "ns":330690279,
  41. "state":1,
  42. "value":"Cannot find information for this network interface in /proc/net/dev."
  43. "id": 2
  44. }
  45. ],
  46. "discovery data":[
  47. {
  48. "clock":1478608764,
  49. "drule":2,
  50. "dcheck":3,
  51. "type":12,
  52. "ip":"10.3.0.10",
  53. "dns":"vdebian",
  54. "status":1
  55. },
  56. {
  57. "clock":1478608764,
  58. "drule":2,
  59. "dcheck":null,
  60. "type":-1,
  61. "ip":"10.3.0.10",
  62. "dns":"vdebian",
  63. "status":1
  64. }
  65. ],
  66. "auto registration":[
  67. {
  68. "clock":1478608371,
  69. "host":"Logger1",
  70. "ip":"10.3.0.1",
  71. "dns":"localhost",
  72. "port":"10050"
  73. },
  74. {
  75. "clock":1478608381,
  76. "host":"Logger2",
  77. "ip":"10.3.0.2",
  78. "dns":"localhost",
  79. "port":"10050"
  80. }
  81. ],
  82. "tasks":[
  83. {
  84. "type": 2,
  85. "clock":1478608371,
  86. "ttl": 600,
  87. "commandtype": 2,
  88. "command": "restart_service1.sh",
  89. "execute_on": 2,
  90. "port": 80,
  91. "authtype": 0,
  92. "username": "userA",
  93. "password": "password1",
  94. "publickey": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqGKukO1De7zhZj6+H0qtjTkVxwTCpvKe",
  95. "privatekey": "lsuusFncCzWBQ7RKNUSesmQRMSGkVb1/3j+skZ6UtW+5u09lHNsj6tQ5QCqGKukO1De7zhd",
  96. "parent_taskid": 10,
  97. "hostid": 10070
  98. },
  99. {
  100. "type": 2,
  101. "clock":1478608381,
  102. "ttl": 600,
  103. "commandtype": 1,
  104. "command": "restart_service2.sh",
  105. "execute_on": 0,
  106. "authtype": 0,
  107. "username": "",
  108. "password": "",
  109. "publickey": "",
  110. "privatekey": "",
  111. "parent_taskid": 20,
  112. "hostid": 10084
  113. }
  114. ],
  115. "tasks":[
  116. {
  117. "type": 0,
  118. "status": 0,
  119. "parent_taskid": 10
  120. },
  121. {
  122. "type": 0,
  123. "status": 1,
  124. "error": "No permissions to execute task.",
  125. "parent_taskid": 20
  126. }
  127. ],
  128. "version":"5.0.0"
  129. }

server→proxy:

  1. {
  2. "response": "success",
  3. "tasks":[
  4. {
  5. "type": 1,
  6. "clock": 1478608371,
  7. "ttl": 600,
  8. "commandtype": 2,
  9. "command": "restart_service1.sh",
  10. "execute_on": 2,
  11. "port": 80,
  12. "authtype": 0,
  13. "username": "userA",
  14. "password": "password1",
  15. "publickey": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqGKukO1De7zhZj6+H0qtjTkVxwTCpvKe",
  16. "privatekey": "lsuusFncCzWBQ7RKNUSesmQRMSGkVb1/3j+skZ6UtW+5u09lHNsj6tQ5QCqGKukO1De7zhd",
  17. "parent_taskid": 10,
  18. "hostid": 10070
  19. },
  20. {
  21. "type": 1,
  22. "clock": 1478608381,
  23. "ttl": 600,
  24. "commandtype": 1,
  25. "command": "restart_service2.sh",
  26. "execute_on": 0,
  27. "authtype": 0,
  28. "username": "",
  29. "password": "",
  30. "publickey": "",
  31. "privatekey": "",
  32. "parent_taskid": 20,
  33. "hostid": 10084
  34. }
  35. ]
  36. }