这是原厂英文文档的翻译页面. 欢迎帮助我们 完善文档.
2022 Zabbix中国峰会
2022 Zabbix中国峰会

Modules

什么是 PHP 前端模块?

  • 模块是一个实体,具有唯一的 ID、名称、描述、作者和在其清单文件中定义的其他字段,以及位于 Zabbix 前端安装的 modules 目录内的单个目录中的 PHP、Javascript 和其他文件(例如,zabbix/ui/modules)。
  • 模块应符合简单的规则以保证正确运行。
  • 必须由管理员在前端安装(解压)并启用模块。

What a module can be used for

  • Adding new functionality via custom frontend sections;
  • Creating custom dashboard widget types (see widget modules);
  • Overriding or extending the existing functionality.

What a module cannot be used for

  • Registering a new API method or modifying an existing one.

How modules work

  • An enabled module is launched on each HTTP request, before executing the action code.
  • The module will register new actions or redefine the existing ones.
  • The module will add new frontend sections and remove or redefine the existing ones.
  • The module will hook to frontend events like onBeforeAction and onTerminate, if needed.
  • The requested action is finally executed by running the action code - either the default one, or module-defined.

Where to start