This is the documentation page for an unsupported version of Zabbix.
Is this not what you were looking for? Switch to the current version or choose one from the drop-down menu.

manifest.json

Any module needs the manifest.json file. The file should be located in the module's primary directory (ui/modules/module_name/manifest.json).

As a bare minimum, manifest.json should specify these fields:

{
           "manifest_version": 2.0,
           "id": "my_ip_address",
           "name": "My IP Address",
           "namespace": "MyIPAddress",
           "version": "1.0"
       }

Parameters supported in manifest.json (press on the parameter name for a detailed description):

Parameter Description Required
manifest_version Manifest version of the module. Yes
id Unique module ID.
name Module name that will be displayed in the Administration section.
namespace PHP namespace for module classes.
version Module version.
type Type of the module. For widget must be set to widget Yes for widgets, otherwise no
widget Widget configuration. Used for widgets only.
actions Actions to register with the module.
assets CSS styles and JavaScript files to include. No
author Module author.
config Default values for custom module options.
description Module description.
url A link to the module description.

manifest_version

A modul manifeszt verziója. Jelenleg a támogatott verzió a 2.0.

Type: Double

Példa:

"manifest_version": 2.0

azonosító

Modulazonosító. Egyedinek kell lennie. A jövőbeni elnevezési ütközések elkerülése érdekében javasolt a modulok előtagjának használata (szerző vagy cégnév, vagy bármi más). Például, ha egy modul egy példa a leckékhez, és a modul neve "Saját modul", akkor az azonosító "example_my_module" lesz.

Type: String

Példa:

"id": "example_my_module"

név

A modul neve amely az Adminisztráció részben fog megjelenni.

Típus: Sztrting

Példa:

"name": "Saját modul"

névtér

PHP névtér modulosztályokhoz.

Típus: Sztring

Példa:

"névtér": "ClockWidget"

verzió

Modul verzió. A verzió az Adminisztráció részben jelenik meg.

Típus: Sztring

Példa:

"verzió": "1.0"

típus

A modul típusa. Kötelező a widgetekhez és egyenlőnek kell lennie a "widget" értékkel.

Típus: Sztring

Alapértelmezett: "modul"

Példa:

"típus": "widget"

actions

Actions to register with the module. Defining class object key for each action is required, other action keys are optional.

Type: Object

Supported object keys if type is module:

  • write.your.action.name (object) - action name, should be written in lowercase [a-z], separating words with dots. Supports the keys:
    • class (string; required) - action class name.
    • layout (string) - action layout. Supported values: layout.json, layout.htmlpage (default), null.
    • view (string) - action view.

Example:

"actions": {
           "module.example.list": {
               "class": "ExampleList",
               "view": "example.list",
               "layout": "layout.htmlpage"
               }
           }

Supported object keys if type is widget:

  • widget.{id}.view (object) - file and class name for widget view. Replace {id} with the widget's id value (for example, widget.example_clock.view). Supports the keys:
    • class (string; required) - action class name for widget view mode to extend the default CControllerDashboardWidgetView class. The class source file must be located in the actions directory.
    • view (string) - widget view. Must be located in the views directory. If the view file is widget.view.php, which is expected by default, this parameter maybe omitted. If using a different name, specify it here.
  • widget.{id}.edit (object) - file name for widget configuration view. Replace {id} with the widget's id value (for example, widget.example_clock.edit). Supports the keys:
    • class (string; required) - action class name for widget configuration view mode. The class source file must be located in the actions directory.
    • view (string) - widget configuration view. Must be located in the views directory. If the view file is widget.edit.php, which is expected by default, this parameter maybe omitted. If using a different name, specify it here.

Example:

"actions": {
           "widget.tophosts.view": {
               "class": "WidgetView"
           },
           "widget.tophosts.column.edit": {
               "class": "ColumnEdit",
               "view": "column.edit",
               "layout": "layout.json"
           }
       }

assets

CSS styles and JavaScript files to include.

Type: Object

Supported object keys:

  • css (array) - CSS files to include. The files must be located in the assets/css.
  • js (array) - JavaScript files to include. The files must be located in the assets/js.

Example:

"assets": {
           "css": ["widget.css"],
           "js": ["widget.js"]
       }

author

Module author. The author will be displayed in the Administration section.

Type: String

Example:

"author": "John Smith"

config

Default values for the module options. The object may contain any custom keys. If specified, these values will be written into the database during module registration. New variables added later will be written upon the first call. Afterwards, the variable values can only be changed directly in the database.

Type: Object

Example:

"config": {
           "username": "Admin",
           "password": "",
           "auth_url": "https://example.com/auth"
       }

description

Module description.

Type: String

Example:

"description": "This is a clock widget."

widget

Widget configuration. Used, if type is set to widget.

Type: Object

Supported object keys:

  • name (string) - used in the widget list and as default header. If empty, "name" parameter from the module will be used.

  • template_support (boolean) - determines whether the widget should be available in template dashboards. Supported values: true, false (default).

  • size (object) - default widget dimensions. Supports keys:

    • width (integer) - default widget width.
    • height (integer) - default widget height.
  • form_class (string) - class with widget fields form. Must be located in the includes directory. If the class is WidgetForm.php, which is expected by default, this parameter maybe omitted. If using a different name, specify it here.

  • js_class (string) - name of a JavaScript class for widget view mode to extend the default CWidget class. The class will be loaded with the dashboard. The class source file must be located in the assets/js directory. See also: assets.

  • use_time_selector (boolean) - determines whether the widget requires dashboard time selector. Supported values: true, false (default).

  • refresh_rate (integer) - widget refresh rate in seconds (default: 60).

Example:

"widget": {
           "name": "",                       
           "template_support": true,      
           "size": {                       
               "width": 12,
               "height": 5
           },
           "form_class": "WidgetForm", 
           "js_class": "CWidget",         
           "use_time_selector": false,    
           "refresh_rate": 60             
       }

url

A link to the module description.

Type: String

Example:

"url": "http://example.com"