Zabbix Documentation 1.8

3.04.04.45.0 (current)| In development:5.2 (devel)| Unsupported:1.82.02.22.43.23.44.2Guidelines

User Tools

Site Tools


Sidebar

api:dhost:get

Table of Contents

get()

Available since version: 1.8
This function allows you to retrieve discovery host 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
druleidsarrayDiscovery rule IDs
dhostidsarrayDiscovery host IDs
dserviceidsarrayDiscovery service IDs
groupidsarrayHost group IDs
hostidsarrayHost IDs
editableintegeronly with read-write permission. Ignored for SuperAdmins
filterarrayOptional filter by discovery host fields
searcharrayReturn discovery hosts by any given discovery host object field pattern
startSearchintegerSearch discovery hosts field pattern only in start of the field
excludeSearchintegerExclude from result, discovery hosts by given field pattern
searchWildcardsEnabledintegerSearch pattern in whole field using wildcards 1 - enable, 0 - disable
outputstringOutput options Values: shorten, refer, extend
selectDRulesstringSelect discovery ruless Values: shorten, refer, extend
selectDChecksstringSelect discovery checks Values: shorten, refer, extend
selectDServicesstringSelect discovery services Values: shorten, refer, extend
selectGroupsstringSelect groups Values: shorten, refer, extend
selectHostsstringSelect hosts Values: shorten, refer, extend
countOutputintegerCount discovery hosts, return the number of discovery hosts found
groupCountintegerReturn the number of results grouped by given IDs
preservekeysintegerReturn hash instead of array Keys of hash are object IDs
sortfieldstringSort by discovery host field Values: dhostid
sortorderstringSort order Values: ASC, DESC
limitintmax number of discovery host objects to return

Returns

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

Example

Get discovery hosts details by discovery rule ID:

{
"jsonrpc":"2.0",
"method":"dhost.get",
"params":{
	"druleids": ["100100000000003"],
	"output": "extend",
	"limit": 3
},
"auth":"6f38cddc44cfbb6c1bd186f9a220b5a0",
"id":2
}
Retrieved discovery host details:

{
"jsonrpc":"2.0",
"result":[{
	"drules":[{
		"druleid":"100100000000003"
	}],
	"dhostid":"100100000000002",
	"druleid":"100100000000003",
	"status":"0",
	"lastup":"1245250108",
	"lastdown":"0"
},{
	"drules":[{
		"druleid":"100100000000003"
	}],
	"dhostid":"100100000000003",
	"druleid":"100100000000003",
	"status":"0",
	"lastup":"1245250130",
	"lastdown":"0"
},{
	"drules":[{
		"druleid":"100100000000003"
	}],
	"dhostid":"100100000000004",
	"druleid":"100100000000003",
	"status":"0",
	"lastup":"1245250131",
	"lastdown":"0"
}],
"id":2
}