The method allows to retrieve graph items according to the given parameters.此方法接受以下参数
Parameters 参数
(object)
Parameters defining the desired output.(关联数组)
定义所需输出的参数
(integer/array)
Returns either:返回整数或数组:
an array of objects返回一个对象数组;
Examples示例
Retrieving graph items from a graph 从图形中检索图形项目
Retrieve all graph items used in a graph with additional information about the item and the host.检索被图形使用的所有图形项目包含监控项和主机的额外信息
Request请求:
- {
- "jsonrpc": "2.0",
- "result": [
- {
- "gitemid": "1242",
- "graphid": "387",
- "itemid": "22665",
- "drawtype": "1",
- "sortorder": "1",
- "color": "FF5555",
- "calc_fnc": "2",
- "type": "0",
- "key_": "system.cpu.util[,steal]",
- "hostid": "10001",
- "flags": "0",
- "host": "Template OS Linux"
- },
- {
- "gitemid": "1243",
- "graphid": "387",
- "itemid": "22668",
- "drawtype": "1",
- "sortorder": "2",
- "color": "55FF55",
- "yaxisside": "0",
- "calc_fnc": "2",
- "type": "0",
- "key_": "system.cpu.util[,softirq]",
- "hostid": "10001",
- "host": "Template OS Linux"
- },
- {
- "gitemid": "1244",
- "graphid": "387",
- "itemid": "22671",
- "drawtype": "1",
- "sortorder": "3",
- "color": "009999",
- "yaxisside": "0",
- "calc_fnc": "2",
- "type": "0",
- "key_": "system.cpu.util[,interrupt]",
- "hostid": "10001",
- "flags": "0",
- "host": "Template OS Linux"
- }
- ],
- "id": 1
Source来源
CGraphItem::get() in frontends/php/include/classes/api/services/CGraphItem.php.