You are viewing documentation for the development version, it may be incomplete.
Join our translation project and help translate Zabbix documentation into your native language.

module.get

Description

integer/array module.get(object parameters)

The method allows to retrieve modules according to the given parameters.

This method is available to users of any type. Permissions to call the method can be revoked in user role settings. See User roles for more information.

Parameters

(object) Parameters defining the desired output.

The method supports the following parameters.

Parameter Type Description
moduleids ID/array Return only modules with the given IDs.
sortfield string/array Sort the result by the given properties.

Possible values: moduleid, relative_path.
countOutput boolean These parameters being common for all get methods are described in detail in the Reference commentary page.
excludeSearch boolean
filter object
limit integer
output query
preservekeys boolean
search object
searchByAny boolean
searchWildcardsEnabled boolean
sortorder string/array
startSearch boolean

Return values

(integer/array) Returns either:

  • an array of objects;
  • the count of retrieved objects, if the countOutput parameter has been used.

Examples

Retrieving a module by ID

Retrieve all data about modules "1", "2", and "25".

Request:

{
           "jsonrpc": "2.0",
           "method": "module.get",
           "params": {
               "output": "extend",
               "moduleids": [
                   "1",
                   "2",
                   "25"
               ]
           },
           "id": 1
       }

Response:

{
           "jsonrpc": "2.0",
           "result": [
               {
                   "moduleid": "1",
                   "id": "actionlog",
                   "relative_path": "widgets/actionlog",
                   "status": "1",
                   "config": []
               },
               {
                   "moduleid": "2",
                   "id": "clock",
                   "relative_path": "widgets/clock",
                   "status": "1",
                   "config": []
               },
               {
                   "moduleid": "25",
                   "id": "example",
                   "relative_path": "modules/example_module",
                   "status": "1",
                   "config": []
               }
           ],
           "id": 1
       }

See also

Source

CModule::get() in ui/include/classes/api/services/CModule.php.