Hi Admin,
I need help.
I have a Zabbix server checking a computer running state. I can get the CPU data from browser like this by this URL
http://my-zabbix-server/chart.php?fr...amp;amp;to=now.....
(PS: below graph is not from my applicaiton, but has same layout)


My question is how to retrieve text data (in above png image) through api_jsonrpc.php ?
I need the the max value for business purpose.


I use Chrome to generate Powershell command to call Zabbix api_jsonrpc.php


Chrome command like this:
I use Invoke-RestMethod instead
But $returnData's result contains one record only, has prevvalue, and lastvalue, but no max value.
May I know how to get the max value, may thanks.
I need help.
I have a Zabbix server checking a computer running state. I can get the CPU data from browser like this by this URL
http://my-zabbix-server/chart.php?fr...amp;amp;to=now.....
(PS: below graph is not from my applicaiton, but has same layout)
My question is how to retrieve text data (in above png image) through api_jsonrpc.php ?
I need the the max value for business purpose.
I use Chrome to generate Powershell command to call Zabbix api_jsonrpc.php
Chrome command like this:
PHP Code:
Invoke-WebRequest -Uri "http://ipaddress/chart.php?from=now-3d&to=now&itemids%5B0%5D=188888&......" -Headers @{
"User-Agent"=Mozilla/5.0....."
"Referer"="http://ipaddress/history.php?action=showgraph&itemids[]=1888888"
...
}
PHP Code:
$from = (Get-Date).AddDays(-3).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")
$to = (Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")
$jsonBodyData = @{
jsonrpc = "2.0"
method = "item.get"
params = @{
output = "extend"
itemids = $itemId
time_from = $from
time_till = $from
sortfield = "clock"
sortorder = "ASC"
}
auth = $authToken
id = 2
} | ConvertTo-Json
$returnData = Invoke-RestMethod -Uri $zabbixApiUrl -Method Post -Body $returnData -ContentType "application/json"
But $returnData's result contains one record only, has prevvalue, and lastvalue, but no max value.
May I know how to get the max value, may thanks.

Comment