Source
warning(_('The cloned host contains user defined macros with type "Secret text". The value and type of these macros were reset.'));
<?php
/*
** Zabbix
** Copyright (C) 2001-2022 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.
**/
require_once dirname(__FILE__).'/include/config.inc.php';
require_once dirname(__FILE__).'/include/forms.inc.php';
$page['title'] = _('Configuration of hosts');
$page['file'] = 'hosts.php';
$page['type'] = detect_page_type(PAGE_TYPE_HTML);
$page['scripts'] = ['multiselect.js', 'textareaflexible.js', 'class.cviewswitcher.js', 'class.cverticalaccordion.js',
'inputsecret.js', 'macrovalue.js'
];
require_once dirname(__FILE__).'/include/page_header.php';
// VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION
$fields = [
'hosts' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null],
'groups' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({add}) || isset({update})'],
'mass_update_groups' => [T_ZBX_INT, O_OPT, null,
IN([ZBX_ACTION_ADD, ZBX_ACTION_REPLACE, ZBX_ACTION_REMOVE]),
null
],
'hostids' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null],
'groupids' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null],
'applications' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null],
'hostid' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, 'isset({form}) && {form} == "update"'],
'clone_hostid' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID,
'isset({form}) && {form} == "full_clone"'
],
'host' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY, 'isset({add}) || isset({update})',
_('Host name')
],
'visiblename' => [T_ZBX_STR, O_OPT, null, null, 'isset({add}) || isset({update})'],
'description' => [T_ZBX_STR, O_OPT, null, null, null],
'proxy_hostid' => [T_ZBX_INT, O_OPT, P_SYS, DB_ID, null],
'status' => [T_ZBX_INT, O_OPT, null,
IN([HOST_STATUS_MONITORED, HOST_STATUS_NOT_MONITORED]), null
],
'interfaces' => [T_ZBX_STR, O_OPT, null, NOT_EMPTY,
'isset({add}) || isset({update})'
],
'mainInterfaces' => [T_ZBX_INT, O_OPT, null, DB_ID, null],
'tags' => [T_ZBX_STR, O_OPT, null, null, null],
'mass_update_tags' => [T_ZBX_INT, O_OPT, null,