Zabbix Documentation 1.8

Sidebar

Table of Contents

get()

Available since version: 1.8
This function allows you to retrieve user 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, Only super admins have access to all users. Admin users may see only users sharing the same user groups. Simple users may gain info only about them selfs.

Parameters

Parameter Type Description Details
nodeids array Node IDs
usrgrpids array User Group IDs
userids array User IDs
mediaids array Media IDs
mediatypeids array Media type IDs
editable integer only with read-write permission. Ignored for SuperAdmins
filter array Optional filter by user fields
search array Return users by any given object field pattern
startSearch integer Search users field pattern only in start of the field
excludeSearch integer Exclude from result, users 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_usrgrps string Select user groups Values: refer, extend
select_mediatypes string Select user media types Values: refer, extend
get_access string Get additional info about user access to GUI Values: shorten, refer, extend
countOutput integer Count users, return the number of users found
preservekeys integer Return hash instead of array Keys of hash are object IDs
sortfield string Sort by user field Values: userid, alias
sortorder string Sort order Values: ASC, DESC
limit int max number of user objects to return

Returns

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

Example

Get users details by user alias "Admin":

{
       "jsonrpc":"2.0",
       "method":"user.get",
       "params":{
           "filter":{ "alias":["Admin"] },
           "output":"extend"
       },
       "auth":"6f38cddc44cfbb6c1bd186f9a220b5a0",
       "id":2
       }

Retrieved user details:

{
       "jsonrpc":"2.0",
       "result":[{
           "userid":"100100000000001",
           "alias":"Admin",
           "name":"admin",
           "surname":"admin",
           "url":"",
           "autologin":"1",
           "autologout":"0",
           "lang":"en_gb",
           "refresh":"2000",
           "type":"3",
           "theme":"css_od.css",
           "attempt_failed":"0",
           "attempt_ip":"127.0.0.1",
           "attempt_clock":"1281014721",
           "rows_per_page":"100"
       }],
       "id":2
       }