Ad Widget

Collapse

How to get values that compose a graph using the API

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • directcuteo
    Junior Member
    • Nov 2021
    • 4

    #1

    How to get values that compose a graph using the API

    Hello! I am trying to create this graph using the API. I discovered that using the graphitem.get method I can get all the lines (green, yellow ...) that make up this graph along with their color, id, and other properties. Is there any way to retrieve all the points that make up this chart through a json API (not a HTML file as the Zabbix page is doing)?

    Click image for larger version

Name:	Screenshot 2021-11-18 121312.png
Views:	1785
Size:	114.3 KB
ID:	435124

    Thank you!
  • kreazy
    Junior Member
    • Nov 2021
    • 4

    #2
    Originally posted by directcuteo
    Hello! I am trying to create this graph using the API. I discovered that using the graphitem.get method I can get all the lines (green, yellow ...) that make up this graph along with their color, id, and other properties. Is there any way to retrieve all the points that make up this chart through a json API (not a HTML file as the Zabbix page is doing)?

    Click image for larger version

Name:	Screenshot 2021-11-18 121312.png
Views:	1785
Size:	114.3 KB
ID:	435124

    Thank you!
    hello. I have the same question like you, How do you monitoring that

    Comment

    • directcuteo
      Junior Member
      • Nov 2021
      • 4

      #3
      I managed to get the data using the history API: https://www.zabbix.com/documentation...ce/history/get

      Comment

      • kreazy
        Junior Member
        • Nov 2021
        • 4

        #4
        Originally posted by directcuteo
        I managed to get the data using the history API: https://www.zabbix.com/documentation...ce/history/get
        I cant get data. Can you show me your json configure ?
        Thank

        Comment

        • directcuteo
          Junior Member
          • Nov 2021
          • 4

          #5
          This is the request I used:

          {
          "jsonrpc": "2.0",
          "method": "history.get",
          "params": {
          "output": "extend",
          "hostids": "123",
          "itemids": "123",
          "sortfield": "clock",
          "limit": 10
          },
          "id": 50,
          "auth": "123123123"
          }


          Just use proper hostId, itemId and correct auth id

          Comment

          Working...