Найти в Дзене
Bearloga

Создание работающего виджета по Zabbix

официальная документация по Zabbix не совсем верная, они ошиблись с папкой, куда нужно модуль размещать ссылка https://www.zabbix.com/documentation/current/en/devel/modules/tutorials/widget Попытка установить модуль в папку modules Tree manifest.json { "manifest_version": 2.0, "id": "hello_world_php", "type": "widget", "name": "Hello world (PHP)", "namespace": "HelloWorldPhp", "version": "1.0", "author": "Zabbix" } View <?php declare(strict_types = 0); /* ** Zabbix ** Copyright (C) 2001-2023 Zabbix SIA ** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. ** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for mor

официальная документация по Zabbix не совсем верная, они ошиблись с папкой, куда нужно модуль размещать

ссылка https://www.zabbix.com/documentation/current/en/devel/modules/tutorials/widget

Попытка установить модуль в папку modules

Tree

-2

manifest.json

{

"manifest_version": 2.0,

"id": "hello_world_php",

"type": "widget",

"name": "Hello world (PHP)",

"namespace": "HelloWorldPhp",

"version": "1.0",

"author": "Zabbix"

}

-3

View

<?php declare(strict_types = 0);

/*

** Zabbix

** Copyright (C) 2001-2023 Zabbix SIA

**

** This program is free software; you can redistribute it and/or modify

** it under the terms of the GNU General Public License as published by

** the Free Software Foundation; either version 2 of the License, or

** (at your option) any later version.

**

** This program is distributed in the hope that it will be useful,

** but WITHOUT ANY WARRANTY; without even the implied warranty of

** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

** GNU General Public License for more details.

**

** You should have received a copy of the GNU General Public License

** along with this program; if not, write to the Free Software

** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

**/

/**

* Hello world widget view.

*

* @var CView $this

* @var array $data

*/

(new CWidgetView($data))

->addItem(

(new CTag('h1', true, 'Hello world!'))->addStyle('text-align: center; font-size: 50px;')

)

->show();

-4

Оно работает

-5