Zabbix Documentation 1.8

Sidebar

Table of Contents

get()

Available since version: 1.8
This function allows you to retrieve host group 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

Parameter Type Description Details
nodeids array Node IDs
groupids array HostGroup IDs
hostids array Host IDs
templateids array Template IDs
triggerids array Trigger IDs
graphids array Graph IDs
proxyids array Return only host groups with hosts, that are monitored by the given proxies.
maintenanceids array Maintenance IDs
monitored_hosts integer return only host groups containing monitored hosts
templated_hosts integer return only host groups containing templates
real_hosts integer return only host groups containing hosts (monitored/not monitored) in result
not_proxy_hosts integer return only host groups not containing Proxies
with_items integer only with items
with_monitored_items integer only with monitored items
with_historical_items integer only with historical items
with_triggers integer only with triggers
with_monitored_triggers integer only with monitored triggers
with_httptests integer only with http tests
with_monitored_httptests integer only with monitored http tests
with_graphs integer only with graphs
editable integer only with read-write permission. Ignored for SuperAdmins
filter array Optional filter by host group fields
search array Return host groups by any given object field pattern
startSearch integer Search host groups field pattern only in start of the field
excludeSearch integer Exclude from result, host groups by given field pattern
searchWildcardsEnabled integer Search pattern in whole field using wildcards 1 - enable, 0 - disable
output string Output options Values: shorten, refer, extend
select_templates string Select contained templates Values: shorten, refer, extend
select_hosts string Select contained hosts Values: shorten, refer, extend
countOutput integer Count host groups, return the number of host groups found
groupCount integer Return the number of results grouped by given IDs
preservekeys integer Return hash instead of array Keys of hash are object IDs
sortfield string Sort by host group field Values: groupid, name
sortorder string Sort order Values: ASC, DESC
limit int Max number of host group objects to return

Returns

Parameter Description
result Operation successful. Result will contain array of Host group objects.
error In case of any errors

Example

Get host groups details by host group name "Zabbix servers","Linux servers":

{
       "jsonrpc":"2.0",
       "method":"hostgroup.get",
       "params":{
           "output": "extend",
           "filter":{
               "name":["Zabbix servers","Linux servers"]
               }
           },
       "auth":"6f38cddc44cfbb6c1bd186f9a220b5a0",
       "id":2
       }

Retrieved host group details:

{
       "jsonrpc":"2.0",
       "result":[
           {
               "groupid":"100100000000002",
               "name":"Linux servers",
               "internal":"0"
           },
           {
               "groupid":"100100000000004",
               "name":"ZABBIX Servers",
               "internal":"0"
           }
       ],
       "id":2
       }