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请求:

    1. {
    2. "jsonrpc": "2.0",
    3. "result": [
    4. {
    5. "gitemid": "1242",
    6. "graphid": "387",
    7. "itemid": "22665",
    8. "drawtype": "1",
    9. "sortorder": "1",
    10. "color": "FF5555",
    11. "calc_fnc": "2",
    12. "type": "0",
    13. "key_": "system.cpu.util[,steal]",
    14. "hostid": "10001",
    15. "flags": "0",
    16. "host": "Template OS Linux"
    17. },
    18. {
    19. "gitemid": "1243",
    20. "graphid": "387",
    21. "itemid": "22668",
    22. "drawtype": "1",
    23. "sortorder": "2",
    24. "color": "55FF55",
    25. "yaxisside": "0",
    26. "calc_fnc": "2",
    27. "type": "0",
    28. "key_": "system.cpu.util[,softirq]",
    29. "hostid": "10001",
    30. "host": "Template OS Linux"
    31. },
    32. {
    33. "gitemid": "1244",
    34. "graphid": "387",
    35. "itemid": "22671",
    36. "drawtype": "1",
    37. "sortorder": "3",
    38. "color": "009999",
    39. "yaxisside": "0",
    40. "calc_fnc": "2",
    41. "type": "0",
    42. "key_": "system.cpu.util[,interrupt]",
    43. "hostid": "10001",
    44. "flags": "0",
    45. "host": "Template OS Linux"
    46. }
    47. ],
    48. "id": 1

    Source来源

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