Source
$link = 'zabbix.php?action=item.list&filter_set=1&context=template&filter_hostids%5B0%5D='.self::$templateid;
<?php
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
require_once dirname(__FILE__).'/../common/testTimeoutsDisplay.php';
/**
* @onBefore prepareTimeoutsData
*
* @backup config, hosts, proxy
*/
class testTimeoutsLinkedTemplates extends testTimeoutsDisplay {
protected static $templateid;
protected static $hostids;
public static function prepareTimeoutsData() {
CDataHelper::call('proxy.create', [
[
'name' => 'Proxy assigned to host',
'operating_mode' => 0
]
]);
$proxyid = CDataHelper::getIds('name');
$template_result = CDataHelper::createTemplates([
[
'host' => 'Template for linking',
'groups' => ['groupid' => 1], // Templates.
'items' => [
[
'name' => 'Zabbix agent',
'key_' => 'zabbix_agent',
'type' => ITEM_TYPE_ZABBIX,
'value_type' => ITEM_VALUE_TYPE_UINT64,
'delay' => 5
],
[
'name' => 'Zabbix agent (active)',
'key_' => 'zabbix_agent_active',
'type' => ITEM_TYPE_ZABBIX_ACTIVE,
'value_type' => ITEM_VALUE_TYPE_UINT64,
'delay' => 5
],
[
'name' => 'Simple check',
'key_' => 'simple_check',
'type' => ITEM_TYPE_SIMPLE,
'value_type' => ITEM_VALUE_TYPE_UINT64,
'delay' => 5
],