Zabbix Documentation 1.8

2.23.04.04.2 (current)In development:4.4 (devel)Unsupported:1.82.02.43.23.4

User Tools

Site Tools


Sidebar

api:item:get

Table of Contents

get()

Available since version: 1.8
This function allows you to retrieve item 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
groupidsarrayHostGroup IDs
hostidsarrayHost IDs
templateidsarrayTemplate IDs
proxyidsarrayReturn only items that belong to the hosts, that are monitored by the given proxies.
itemidsarrayItem IDs
graphidsarrayGraph IDs
triggeridsarrayTrigger IDs
applicationidsarrayApplication IDs
webitemsintegerSearch also in web items
inheritedintegerInherited from templates “0” - not inherited, “1” - inherited
templatedintegerTemplated items “0” - belongs to hosts, “1” - belongs to templates
monitoredintegerMonitored items Checks item and host status
editableintegeronly with read-write permission. Ignored for SuperAdmins
groupstringOptional filter by host group name
hoststringOptional filter by host name
applicationstringOptional filter by application name
belongsstringOptional filter by host fields
with_triggersintegerItems with triggers
filterarrayOptional filter by item fields
searchstringReturn items by given item fields pattern
startSearchintegerSearch given patterns only in start of the field
excludeSearchintegerExclude from result items by given patterns
searchWildcardsEnabledintegerSearch pattern in whole field using wildcards 1 - enable, 0 - disable
outputstringOutput options Values: shorten, refer, extend
select_hostsstringSelect hosts Values: shorten, refer, extend
select_triggersstringSelect item triggers Values: shorten, refer, extend
select_graphsstringSelect item graphs Values: shorten, refer, extend
select_applicationsstringSelect item applications Values: shorten, refer, extend
countOutputintegerCount hosts, return the number of items found
groupCountintegerReturn the number of results grouped by given IDs
preservekeysintegerReturn hash instead of array Keys of hash are object IDs
sortfieldstringSort by item field Values: itemid, description, key_, delay, history, trends, type, status
sortorderstringSort order Values: ASC, DESC
limitintmax number of item objects to return

Returns

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

Example

Get items details by item description pattern “Apache” and limit output to 10 items, return only item IDS:

{
"jsonrpc":"2.0",
"method":"item.get",
"params":{
	"output":"shorten",
	"search": {"description": "apache"},
	"limit": 10
},
"auth":"6f38cddc44cfbb6c1bd186f9a220b5a0",
"id":2
}

Retrieved items details:

{
"jsonrpc":"2.0",
"result":[
	{"itemid":"100100000010048"},
	{"itemid":"100100000010137"},
	{"itemid":"100100000017431"},
	{"itemid":"100100000017533"},
	{"itemid":"100100000017635"},
	{"itemid":"100100000017737"},
	{"itemid":"100100000017839"},
	{"itemid":"100100000017941"},
	{"itemid":"100100000018043"},
	{"itemid":"100100000018145"}
],
"id":2
}