Ad Widget

Collapse

Zabbix api value is different from Graph value

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BlackCrystal
    Junior Member
    • Dec 2018
    • 28

    #1

    Zabbix api value is different from Graph value

    HI. i have zabbix 5. I've been trying to write a shell script to get item trend for a range of time. the shell script works correctly but the value it return doesn't match what is showing on graph.
    for example:

    I have an item with itemid "10234" which return "percentage of used CPU".
    i want to get the zabbix trend for this item from "2021/09/20 09:00:00" till "2021/09/21 09:00:00".
    Unix time for this rang is: 1632112200 , 1632198600

    I run this command to get the values:
    curl -L -k -i -X POST -H 'Content-Type:application/json' -d '{"jsonrpc":"2.0","method":"trend.get","id":1,"aut h":"1a543455bd48e6ddc222219acccb52e9","params" : {"output": ["clock","value_avg","value_min","value_max","n um", "itemid"],"itemids":["10234"],"time_from": "1632112200","time_till": "1632198600", "limit": "1"}}' https://172.30.134.03:423//api_jsonrpc.php

    output: {"clock":"1632114000","value_avg":"14.968717529411 764","value_min":"12.683622999999997","value_max": "17.635707999999994"}

    but in Graph it shows:
    Click image for larger version

Name:	zabzab.png
Views:	193
Size:	5.4 KB
ID:	432366

    why this happen and how can i fix this?
Working...