Zabbix Documentation 1.8

Sidebar

Table of Contents

get()

Available since version: 1.8
This function allows you to retrieve mediatype 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
userids array User IDs
mediaids array User media IDs
mediatypeids array Mediatype IDs
editable integer only with read-write permission. Ignored for SuperAdmins
filter array Optional filter by mediatype fields
search string Return mediatypes by given mediatype fields pattern
startSearch integer Search given patterns only in start of the field
excludeSearch integer Exclude from result mediatypes by given patterns
searchWildcardsEnabled integer Search pattern in whole field using wildcards 1 - enable, 0 - disable
output string Output options Values: shorten, refer, extend
select_users string Select users Values: shorten, refer, extend
select_medias string Select user media Values: shorten, refer, extend
countOutput integer Count mediatypes, returned the number of mediatypes 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 mediatype field Values: mediatypeid
sortorder string Sort order Values: ASC, DESC
limit int max number mediatype of objects to return

Returns

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

Example

Get mediatypes details by mediatype description pattern "sms" and limit output to 1 mediatype, return full mediatype object:

{
       "jsonrpc": "2.0",
       "method": "mediatype.get",
       "params": {
           "search": {"description": "sms"},
           "output": "extend",
       },
       "auth": "6f38cddc44cfbb6c1bd186f9a220b5a0",
       "id": 2
       }

Retrieved mediatypes details:

{
       "jsonrpc": "2.0",
       "result": [{
           "mediatypeid": "100100000000003",
           "type": "2",
           "description": "SMS",
           "smtp_server": "",
           "smtp_helo": "",
           "smtp_email": "",
           "exec_path": "",
           "gsm_modem": "\/dev\/ttyS0",
           "username": "",
           "passwd": ""
       }],
       "id": 2
       }