The method allows to retrieve scripts according to the given parameters. 此方法允许检索符合所给参数的脚本

    Parameters 参数

    (object) Parameters defining the desired output. (object) 定义所需输出的参数。

    The method supports the following parameters. 此方法支持以下参数

    (integer/array) Returns either:

    • the count of retrieved objects, if the countOutput parameter has been used.

    • 一个数组对象

    • 检索到对象的数目,如果countOutput参数被使用

    Examples 示例如下

    Retrieve all scripts 检索所有脚本

    Retrieve all configured scripts. 检索所有的已确认的脚本

    Response:

    1. {
    2. "jsonrpc": "2.0",
    3. "result": [
    4. {
    5. "name": "Ping",
    6. "host_access": "2",
    7. "usrgrpid": "0",
    8. "groupid": "0",
    9. "description": "",
    10. "confirmation": "",
    11. "type": "0",
    12. "execute_on": "1"
    13. },
    14. {
    15. "scriptid": "2",
    16. "name": "Traceroute",
    17. "command": "/usr/bin/traceroute {HOST.CONN} 2>&1",
    18. "host_access": "2",
    19. "usrgrpid": "0",
    20. "groupid": "0",
    21. "description": "",
    22. "execute_on": "1"
    23. },
    24. {
    25. "scriptid": "3",
    26. "name": "Detect operating system",
    27. "command": "sudo /usr/bin/nmap -O {HOST.CONN} 2>&1",
    28. "host_access": "2",
    29. "usrgrpid": "7",
    30. "groupid": "0",
    31. "description": "",
    32. "confirmation": "",
    33. "type": "0",
    34. "execute_on": "1"
    35. }
    36. ],
    37. "id": 1
    38. }

    Source

    CScript::get() in frontends/php/include/classes/api/services/CScript.php.