该方法允许根据给定的参数检索监控项。
(object)
定义所需输出的参数。
该方法支持以下参数。
通过 Key 查询 Items
Request:
Response:
- {
- "jsonrpc": "2.0",
- "result": [
- {
- "itemid": "23298",
- "type": "0",
- "snmp_community": "",
- "snmp_oid": "",
- "hostid": "10084",
- "name": "Context switches per second",
- "key_": "system.cpu.switches",
- "delay": "1m",
- "history": "7d",
- "trends": "365d",
- "lastvalue": "2552",
- "lastclock": "1351090998",
- "prevvalue": "2641",
- "state": "0",
- "status": "0",
- "value_type": "3",
- "trapper_hosts": "",
- "units": "sps",
- "multiplier": "0",
- "delta": "1",
- "snmpv3_securityname": "",
- "snmpv3_securitylevel": "0",
- "snmpv3_authpassphrase": "",
- "snmpv3_privpassphrase": "",
- "snmpv3_authprotocol": "0",
- "snmpv3_privprotocol": "0",
- "snmpv3_contextname": "",
- "formula": "1",
- "error": "",
- "lastlogsize": "0",
- "logtimefmt": "",
- "templateid": "22680",
- "valuemapid": "0",
- "params": "",
- "ipmi_sensor": "",
- "data_type": "0",
- "authtype": "0",
- "username": "",
- "password": "",
- "publickey": "",
- "privatekey": "",
- "mtime": "0",
- "lastns": "564054253",
- "flags": "0",
- "interfaceid": "1",
- "port": "",
- "description": "",
- "lifetime": "0s",
- "evaltype": "0"
- },
- {
- "itemid": "23299",
- "type": "0",
- "snmp_community": "",
- "snmp_oid": "",
- "hostid": "10084",
- "name": "CPU $2 time",
- "key_": "system.cpu.util[,idle]",
- "delay": "1m",
- "history": "7d",
- "trends": "365d",
- "lastvalue": "86.031879",
- "lastclock": "1351090999",
- "prevvalue": "85.306944",
- "state": "0",
- "status": "0",
- "value_type": "0",
- "trapper_hosts": "",
- "units": "%",
- "multiplier": "0",
- "delta": "0",
- "snmpv3_securityname": "",
- "snmpv3_securitylevel": "0",
- "snmpv3_authpassphrase": "",
- "snmpv3_privpassphrase": "",
- "snmpv3_authprotocol": "0",
- "snmpv3_privprotocol": "0",
- "snmpv3_contextname": "",
- "formula": "1",
- "error": "",
- "lastlogsize": "0",
- "logtimefmt": "",
- "templateid": "17354",
- "valuemapid": "0",
- "params": "",
- "ipmi_sensor": "",
- "data_type": "0",
- "authtype": "0",
- "username": "",
- "password": "",
- "publickey": "",
- "privatekey": "",
- "mtime": "0",
- "lastns": "564256864",
- "flags": "0",
- "interfaceid": "1",
- "port": "",
- "description": "The time the CPU has spent doing nothing.",
- "inventory_link": "0",
- "lifetime": "0s",
- "evaltype": "0"
- },
- {
- "itemid": "23300",
- "snmp_community": "",
- "snmp_oid": "",
- "hostid": "10084",
- "name": "CPU $2 time",
- "key_": "system.cpu.util[,interrupt]",
- "history": "7d",
- "trends": "365d",
- "lastvalue": "0.008389",
- "lastclock": "1351091000",
- "prevvalue": "0.000000",
- "state": "0",
- "status": "0",
- "value_type": "0",
- "trapper_hosts": "",
- "units": "%",
- "multiplier": "0",
- "delta": "0",
- "snmpv3_securityname": "",
- "snmpv3_securitylevel": "0",
- "snmpv3_authpassphrase": "",
- "snmpv3_privpassphrase": "",
- "snmpv3_authprotocol": "0",
- "snmpv3_privprotocol": "0",
- "snmpv3_contextname": "",
- "formula": "1",
- "error": "",
- "lastlogsize": "0",
- "logtimefmt": "",
- "templateid": "22671",
- "valuemapid": "0",
- "params": "",
- "ipmi_sensor": "",
- "data_type": "0",
- "authtype": "0",
- "username": "",
- "password": "",
- "publickey": "",
- "privatekey": "",
- "mtime": "0",
- "lastns": "564661387",
- "flags": "0",
- "interfaceid": "1",
- "port": "",
- "description": "The amount of time the CPU has been servicing hardware interrupts.",
- "inventory_link": "0",
- "lifetime": "0s",
- "evaltype": "0"
- }
- ],
- "id": 1
- }
CItem::get() in frontends/php/include/classes/api/services/CItem.php.