此方法用于根据给定参数来获取图表监控项。

    参数

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

    (整数/数组) 返回:

    • 一个数组对象;

    示例

    从图表中获取图表监控项

    获取图表中使用的所有图表监控项以及有关监控项和主机的其他信息。

    请求:

    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. "hostid": "10001",
    14. "flags": "0",
    15. "host": "Template OS Linux"
    16. },
    17. {
    18. "gitemid": "1243",
    19. "graphid": "387",
    20. "itemid": "22668",
    21. "drawtype": "1",
    22. "sortorder": "2",
    23. "color": "55FF55",
    24. "yaxisside": "0",
    25. "calc_fnc": "2",
    26. "type": "0",
    27. "key_": "system.cpu.util[,softirq]",
    28. "hostid": "10001",
    29. "host": "Template OS Linux"
    30. {
    31. "gitemid": "1244",
    32. "graphid": "387",
    33. "itemid": "22671",
    34. "drawtype": "1",
    35. "sortorder": "3",
    36. "color": "009999",
    37. "yaxisside": "0",
    38. "calc_fnc": "2",
    39. "type": "0",
    40. "key_": "system.cpu.util[,interrupt]",
    41. "hostid": "10001",
    42. "flags": "0",
    43. "host": "Template OS Linux"
    44. }
    45. ],
    46. "id": 1

    来源

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