Source
<?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 testTimeoutsHosts extends testTimeoutsDisplay {
protected static $hostids;
protected static $hostids_druleids;
public static function prepareTimeoutsData() {
CDataHelper::call('proxy.create', [
[
'name' => 'Proxy assigned to host',
'operating_mode' => 0
]
]);
$proxyid = CDataHelper::getIds('name');
$host_result = CDataHelper::createHosts([
[
'host' => 'Host for timeouts check',
'groups' => [
[
'groupid' => 4 // Zabbix servers
]
],
'interfaces' => [
[
'type'=> INTERFACE_TYPE_AGENT,
'main' => INTERFACE_PRIMARY,
'useip' => INTERFACE_USE_DNS,
'ip' => '',
'dns' => 'zabbix_agent',
'port' => '1'
],
[
'type'=> INTERFACE_TYPE_SNMP,
'main' => INTERFACE_PRIMARY,
'useip' => INTERFACE_USE_DNS,
'ip' => '',
'dns' => 'snmp',
'port' => '2',
'details' => [
'version' => 1,