This method allows to retrieve scripts available on the given hosts. 此方法允许检索适用所给主机的脚本

    (string/array) IDs of hosts to return scripts for. (string/array) 主机IDs

    The method will automatically expand macros in the confirmation text.

    该方法将在confirmation文本中自动扩展宏。

    Retrieve scripts by host IDs 通过主机的ids检索脚本

    Request:

    Response:

    1. {
    2. "jsonrpc": "2.0",
    3. "result": {
    4. "30079": [
    5. {
    6. "scriptid": "3",
    7. "name": "Detect operating system",
    8. "command": "sudo /usr/bin/nmap -O {HOST.CONN} 2>&1",
    9. "host_access": "2",
    10. "usrgrpid": "7",
    11. "groupid": "0",
    12. "description": "",
    13. "confirmation": "",
    14. "type": "0",
    15. "execute_on": "1",
    16. "hostid": "10001"
    17. },
    18. {
    19. "scriptid": "1",
    20. "name": "Ping",
    21. "command": "/bin/ping -c 3 {HOST.CONN} 2>&1",
    22. "host_access": "2",
    23. "usrgrpid": "0",
    24. "groupid": "0",
    25. "confirmation": "",
    26. "type": "0",
    27. "execute_on": "1",
    28. "hostid": "10001"
    29. },
    30. {
    31. "scriptid": "2",
    32. "name": "Traceroute",
    33. "command": "/usr/bin/traceroute {HOST.CONN} 2>&1",
    34. "host_access": "2",
    35. "usrgrpid": "0",
    36. "groupid": "0",
    37. "description": "",
    38. "confirmation": "",
    39. "type": "0",
    40. "execute_on": "1",
    41. "hostid": "10001"
    42. }
    43. ],
    44. "30073": [
    45. {
    46. "scriptid": "3",
    47. "name": "Detect operating system",
    48. "command": "sudo /usr/bin/nmap -O {HOST.CONN} 2>&1",
    49. "host_access": "2",
    50. "usrgrpid": "7",
    51. "groupid": "0",
    52. "description": "",
    53. "confirmation": "",
    54. "type": "0",
    55. "hostid": "10001"
    56. },
    57. {
    58. "scriptid": "1",
    59. "name": "Ping",
    60. "command": "/bin/ping -c 3 {HOST.CONN} 2>&1",
    61. "host_access": "2",
    62. "usrgrpid": "0",
    63. "groupid": "0",
    64. "description": "",
    65. "confirmation": "",
    66. "type": "0",
    67. "execute_on": "1",
    68. "hostid": "10001"
    69. },
    70. {
    71. "scriptid": "2",
    72. "name": "Traceroute",
    73. "command": "/usr/bin/traceroute {HOST.CONN} 2>&1",
    74. "host_access": "2",
    75. "usrgrpid": "0",
    76. "groupid": "0",
    77. "description": "",
    78. "confirmation": "",
    79. "type": "0",
    80. "execute_on": "1",
    81. "hostid": "10001"
    82. }
    83. ]
    84. },
    85. }