itemprototype.get

    The method allows to retrieve item prototypes according to the given parameters.

    This method is available to users of any type. Permissions to call the method can be revoked in user role settings. See User roles for more information.

    Parameters

    (object) Parameters defining the desired output.

    The method supports the following parameters.

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

    Examples

    Retrieving item prototypes from an LLD rule

    Retrieve all item prototypes from an LLD rule.

    Request:

    Response:

    1. {
    2. "jsonrpc": "2.0",
    3. "result": [
    4. {
    5. "itemid": "23077",
    6. "type": "0",
    7. "snmp_oid": "",
    8. "hostid": "10079",
    9. "name": "Incoming network traffic on en0",
    10. "key_": "net.if.in[en0]",
    11. "delay": "1m",
    12. "history": "1w",
    13. "trends": "365d",
    14. "status": "0",
    15. "value_type": "3",
    16. "trapper_hosts": "",
    17. "units": "bps",
    18. "formula": "",
    19. "error": "",
    20. "logtimefmt": "",
    21. "templateid": "0",
    22. "valuemapid": "0",
    23. "params": "",
    24. "ipmi_sensor": "",
    25. "authtype": "0",
    26. "username": "",
    27. "password": "",
    28. "publickey": "",
    29. "privatekey": "",
    30. "flags": "0",
    31. "interfaceid": "0",
    32. "description": "",
    33. "inventory_link": "0",
    34. "lifetime": "30d",
    35. "state": "0",
    36. "evaltype": "0",
    37. "jmx_endpoint": "",
    38. "master_itemid": "0",
    39. "timeout": "3s",
    40. "url": "",
    41. "query_fields": [],
    42. "posts": "",
    43. "status_codes": "200",
    44. "follow_redirects": "1",
    45. "post_type": "0",
    46. "http_proxy": "",
    47. "headers": [],
    48. "retrieve_mode": "0",
    49. "request_method": "0",
    50. "output_format": "0",
    51. "ssl_cert_file": "",
    52. "ssl_key_file": "",
    53. "ssl_key_password": "",
    54. "verify_peer": "0",
    55. "verify_host": "0",
    56. "allow_traps": "0",
    57. "lastclock": "0",
    58. "lastns": "0",
    59. "lastvalue": "0",
    60. "prevvalue": "0",
    61. "discover": "0",
    62. "parameters": []
    63. },
    64. {
    65. "itemid": "10010",
    66. "snmp_oid": "",
    67. "hostid": "10001",
    68. "name": "Processor load (1 min average per core)",
    69. "key_": "system.cpu.load[percpu,avg1]",
    70. "delay": "1m",
    71. "history": "1w",
    72. "trends": "365d",
    73. "status": "0",
    74. "value_type": "0",
    75. "trapper_hosts": "",
    76. "units": "",
    77. "formula": "",
    78. "logtimefmt": "",
    79. "templateid": "0",
    80. "valuemapid": "0",
    81. "params": "",
    82. "ipmi_sensor": "",
    83. "authtype": "0",
    84. "username": "",
    85. "password": "",
    86. "publickey": "",
    87. "privatekey": "",
    88. "flags": "0",
    89. "interfaceid": "0",
    90. "description": "The processor load is calculated as system CPU load divided by number of CPU cores.",
    91. "inventory_link": "0",
    92. "lifetime": "0",
    93. "state": "0",
    94. "evaltype": "0",
    95. "jmx_endpoint": "",
    96. "master_itemid": "0",
    97. "timeout": "3s",
    98. "url": "",
    99. "query_fields": [],
    100. "posts": "",
    101. "status_codes": "200",
    102. "follow_redirects": "1",
    103. "post_type": "0",
    104. "http_proxy": "",
    105. "headers": [],
    106. "retrieve_mode": "0",
    107. "request_method": "0",
    108. "output_format": "0",
    109. "ssl_cert_file": "",
    110. "ssl_key_file": "",
    111. "ssl_key_password": "",
    112. "verify_peer": "0",
    113. "verify_host": "0",
    114. "allow_traps": "0",
    115. "lastclock": "0",
    116. "lastns": "0",
    117. "lastvalue": "0",
    118. "prevvalue": "0",
    119. "discover": "0",
    120. "parameters": []
    121. }
    122. ],
    123. "id": 1
    124. }

    Finding dependent item

    Find one Dependent item for item with ID “25545”.

    Response:

    1. {
    2. "jsonrpc": "2.0",
    3. "result": [
    4. {
    5. "itemid": "25547",
    6. "type": "18",
    7. "snmp_oid": "",
    8. "hostid": "10116",
    9. "name": "Seconds",
    10. "key_": "apache.status.uptime.seconds",
    11. "delay": "0",
    12. "history": "90d",
    13. "trends": "365d",
    14. "status": "0",
    15. "value_type": "3",
    16. "trapper_hosts": "",
    17. "units": "",
    18. "formula": "",
    19. "error": "",
    20. "logtimefmt": "",
    21. "templateid": "0",
    22. "valuemapid": "0",
    23. "params": "",
    24. "ipmi_sensor": "",
    25. "authtype": "0",
    26. "username": "",
    27. "password": "",
    28. "publickey": "",
    29. "privatekey": "",
    30. "flags": "0",
    31. "interfaceid": "0",
    32. "description": "",
    33. "inventory_link": "0",
    34. "state": "0",
    35. "evaltype": "0",
    36. "master_itemid": "25545",
    37. "jmx_endpoint": "",
    38. "master_itemid": "0",
    39. "timeout": "3s",
    40. "url": "",
    41. "query_fields": [],
    42. "status_codes": "200",
    43. "follow_redirects": "1",
    44. "post_type": "0",
    45. "http_proxy": "",
    46. "headers": [],
    47. "retrieve_mode": "0",
    48. "request_method": "0",
    49. "output_format": "0",
    50. "ssl_cert_file": "",
    51. "ssl_key_file": "",
    52. "ssl_key_password": "",
    53. "verify_peer": "0",
    54. "verify_host": "0",
    55. "allow_traps": "0",
    56. "lastclock": "0",
    57. "lastns": "0",
    58. "lastvalue": "0",
    59. "prevvalue": "0",
    60. "discover": "0",
    61. "parameters": []
    62. }
    63. ],
    64. "id": 1
    65. }

    Find HTTP agent item prototype

    Find HTTP agent item prototype with request method HEAD for specific host id.

    Request:

    Response:

    1. {
    2. "jsonrpc": "2.0",
    3. "result": [
    4. {
    5. "itemid": "28257",
    6. "type": "19",
    7. "snmp_oid": "",
    8. "hostid": "10254",
    9. "name": "discovered",
    10. "key_": "item[{#INAME}]",
    11. "delay": "{#IUPDATE}",
    12. "history": "90d",
    13. "trends": "30d",
    14. "status": "0",
    15. "value_type": "3",
    16. "trapper_hosts": "",
    17. "units": "",
    18. "formula": "",
    19. "error": "",
    20. "logtimefmt": "",
    21. "templateid": "28255",
    22. "valuemapid": "0",
    23. "params": "",
    24. "ipmi_sensor": "",
    25. "authtype": "0",
    26. "username": "",
    27. "password": "",
    28. "publickey": "",
    29. "privatekey": "",
    30. "flags": "2",
    31. "interfaceid": "2",
    32. "description": "",
    33. "inventory_link": "0",
    34. "lifetime": "30d",
    35. "state": "0",
    36. "evaltype": "0",
    37. "jmx_endpoint": "",
    38. "master_itemid": "0",
    39. "timeout": "3s",
    40. "url": "{#IURL}",
    41. "query_fields": [],
    42. "posts": "",
    43. "status_codes": "",
    44. "follow_redirects": "0",
    45. "post_type": "0",
    46. "http_proxy": "",
    47. "headers": [],
    48. "retrieve_mode": "0",
    49. "request_method": "3",
    50. "output_format": "0",
    51. "ssl_cert_file": "",
    52. "ssl_key_file": "",
    53. "ssl_key_password": "",
    54. "verify_peer": "0",
    55. "verify_host": "0",
    56. "allow_traps": "0",
    57. "discover": "0",
    58. "parameters": []
    59. }
    60. ],
    61. }

    Source