该方法允许根据给定的参数检索监控项。

    (object) 定义所需输出的参数。

    该方法支持以下参数。

    通过 Key 查询 Items

    Request:

    Response:

    1. {
    2. "jsonrpc": "2.0",
    3. "result": [
    4. {
    5. "itemid": "23298",
    6. "type": "0",
    7. "snmp_community": "",
    8. "snmp_oid": "",
    9. "hostid": "10084",
    10. "name": "Context switches per second",
    11. "key_": "system.cpu.switches",
    12. "delay": "1m",
    13. "history": "7d",
    14. "trends": "365d",
    15. "lastvalue": "2552",
    16. "lastclock": "1351090998",
    17. "prevvalue": "2641",
    18. "state": "0",
    19. "status": "0",
    20. "value_type": "3",
    21. "trapper_hosts": "",
    22. "units": "sps",
    23. "multiplier": "0",
    24. "delta": "1",
    25. "snmpv3_securityname": "",
    26. "snmpv3_securitylevel": "0",
    27. "snmpv3_authpassphrase": "",
    28. "snmpv3_privpassphrase": "",
    29. "snmpv3_authprotocol": "0",
    30. "snmpv3_privprotocol": "0",
    31. "snmpv3_contextname": "",
    32. "formula": "1",
    33. "error": "",
    34. "lastlogsize": "0",
    35. "logtimefmt": "",
    36. "templateid": "22680",
    37. "valuemapid": "0",
    38. "params": "",
    39. "ipmi_sensor": "",
    40. "data_type": "0",
    41. "authtype": "0",
    42. "username": "",
    43. "password": "",
    44. "publickey": "",
    45. "privatekey": "",
    46. "mtime": "0",
    47. "lastns": "564054253",
    48. "flags": "0",
    49. "interfaceid": "1",
    50. "port": "",
    51. "description": "",
    52. "lifetime": "0s",
    53. "evaltype": "0"
    54. },
    55. {
    56. "itemid": "23299",
    57. "type": "0",
    58. "snmp_community": "",
    59. "snmp_oid": "",
    60. "hostid": "10084",
    61. "name": "CPU $2 time",
    62. "key_": "system.cpu.util[,idle]",
    63. "delay": "1m",
    64. "history": "7d",
    65. "trends": "365d",
    66. "lastvalue": "86.031879",
    67. "lastclock": "1351090999",
    68. "prevvalue": "85.306944",
    69. "state": "0",
    70. "status": "0",
    71. "value_type": "0",
    72. "trapper_hosts": "",
    73. "units": "%",
    74. "multiplier": "0",
    75. "delta": "0",
    76. "snmpv3_securityname": "",
    77. "snmpv3_securitylevel": "0",
    78. "snmpv3_authpassphrase": "",
    79. "snmpv3_privpassphrase": "",
    80. "snmpv3_authprotocol": "0",
    81. "snmpv3_privprotocol": "0",
    82. "snmpv3_contextname": "",
    83. "formula": "1",
    84. "error": "",
    85. "lastlogsize": "0",
    86. "logtimefmt": "",
    87. "templateid": "17354",
    88. "valuemapid": "0",
    89. "params": "",
    90. "ipmi_sensor": "",
    91. "data_type": "0",
    92. "authtype": "0",
    93. "username": "",
    94. "password": "",
    95. "publickey": "",
    96. "privatekey": "",
    97. "mtime": "0",
    98. "lastns": "564256864",
    99. "flags": "0",
    100. "interfaceid": "1",
    101. "port": "",
    102. "description": "The time the CPU has spent doing nothing.",
    103. "inventory_link": "0",
    104. "lifetime": "0s",
    105. "evaltype": "0"
    106. },
    107. {
    108. "itemid": "23300",
    109. "snmp_community": "",
    110. "snmp_oid": "",
    111. "hostid": "10084",
    112. "name": "CPU $2 time",
    113. "key_": "system.cpu.util[,interrupt]",
    114. "history": "7d",
    115. "trends": "365d",
    116. "lastvalue": "0.008389",
    117. "lastclock": "1351091000",
    118. "prevvalue": "0.000000",
    119. "state": "0",
    120. "status": "0",
    121. "value_type": "0",
    122. "trapper_hosts": "",
    123. "units": "%",
    124. "multiplier": "0",
    125. "delta": "0",
    126. "snmpv3_securityname": "",
    127. "snmpv3_securitylevel": "0",
    128. "snmpv3_authpassphrase": "",
    129. "snmpv3_privpassphrase": "",
    130. "snmpv3_authprotocol": "0",
    131. "snmpv3_privprotocol": "0",
    132. "snmpv3_contextname": "",
    133. "formula": "1",
    134. "error": "",
    135. "lastlogsize": "0",
    136. "logtimefmt": "",
    137. "templateid": "22671",
    138. "valuemapid": "0",
    139. "params": "",
    140. "ipmi_sensor": "",
    141. "data_type": "0",
    142. "authtype": "0",
    143. "username": "",
    144. "password": "",
    145. "publickey": "",
    146. "privatekey": "",
    147. "mtime": "0",
    148. "lastns": "564661387",
    149. "flags": "0",
    150. "interfaceid": "1",
    151. "port": "",
    152. "description": "The amount of time the CPU has been servicing hardware interrupts.",
    153. "inventory_link": "0",
    154. "lifetime": "0s",
    155. "evaltype": "0"
    156. }
    157. ],
    158. "id": 1
    159. }

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