Zabbix Documentation 1.8

3.04.04.2 (current)In development:4.4 (devel)Unsupported:1.82.02.22.43.23.4

User Tools

Site Tools


Sidebar

api:graphitem:get

Table of Contents

get()

Available since version: 1.8
This function allows you to retrieve graph details based on filtering options. All parameters are optional. If parameter is set in query this option counted as ON, except if parameter is equal to NULL.

Parameters

ParameterTypeDescriptionDetails
nodeidsarrayNode IDs
graphidsarrayGraph IDs
itemidsarrayItem IDs
typeintegerGraph item type
editableintegeronly with read-write permission. Ignored for SuperAdmins
outputstringOutput options Values: shorten, refer, extend
expandDatastringAdd additional fields to result Values: shorten, refer, extend
select_graphsstringSelect graphs Values: shorten, refer, extend
countOutputintegerCount graphs items, return the number of graph items found
preservekeysintegerReturn hash instead of array Keys of hash are object IDs
sortfieldstringSort by graph item field Values: gitemid
sortorderstringSort order Values: ASC, DESC
limitintmax number of graph item objects to return

Returns

ParameterDescription
resultOperation successful. Result will contain array of graph objects.
errorIn case of any errors

Example

Get graph items details by graph ID:

{
"jsonrpc":"2.0",
"method":"graphitem.get",
"params":{
	"graphids": ["100100000012214"],
	"output": "extend"
},
"auth":"6f38cddc44cfbb6c1bd186f9a220b5a0",
"id":2
}

Retrieved graph item details:

{
"jsonrpc":"2.0",
"result":
[{
	"graphs":[{
		"graphid":"100100000012214"
	}],
	"gitemid":"100100000025237",
	"graphid":"100100000012214",
	"itemid":"100100000018506",
	"drawtype":"0",
	"sortorder":"0",
	"color":"009900",
	"yaxisside":"1",
	"calc_fnc":"2",
	"type":"0",
	"periods_cnt":"5"
},{
	"graphs":[{
		"graphid":"100100000012214"
	}],
	"gitemid":"100100000025240",
	"graphid":"100100000012214",
	"itemid":"100100000018529",
	"drawtype":"0",
	"sortorder":"6",
	"color":"660066",
	"yaxisside":"1",
	"calc_fnc":"2",
	"type":"0",
	"periods_cnt":"5"
}],
"id":2
}