Source
'Cannot find item "%1$s" on "%2$s" used as the Y axis MIN value for graph prototype "%3$s" of discovery rule "%4$s" on "%5$s".',
<?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/>.
**/
/**
* Class for importing configuration data.
*/
class CConfigurationImport {
/**
* @var CImportDataAdapter
*/
protected $adapter;
/**
* @var CImportReferencer
*/
protected $referencer;
/**
* @var CImportedObjectContainer
*/
protected $importedObjectContainer;
/**
* @var array
*/
protected $options;
/**
* @var array with data read from source string
*/
protected $data;
/**
* @var array cached data from the adapter
*/
protected $formattedData = [];
/**
* Constructor.
* Source string must be suitable for reader class,
* i.e. if string contains json then reader should be able to read json.
*
* @param array $options import options "createMissing", "updateExisting" and "deleteMissing"
* @param CImportReferencer $referencer class containing all importable objects
* @param CImportedObjectContainer $importedObjectContainer class containing processed host and template IDs
*/
public function __construct(array $options, CImportReferencer $referencer,
CImportedObjectContainer $importedObjectContainer) {
$default_options = [
'template_groups' => ['updateExisting' => false, 'createMissing' => false],
'templates' => ['updateExisting' => false, 'createMissing' => false],
'host_groups' => ['updateExisting' => false, 'createMissing' => false],
'hosts' => ['updateExisting' => false, 'createMissing' => false],
'templateDashboards' => ['updateExisting' => false, 'createMissing' => false, 'deleteMissing' => false],
'templateLinkage' => ['createMissing' => false, 'deleteMissing' => false],
'items' => ['updateExisting' => false, 'createMissing' => false, 'deleteMissing' => false],
'discoveryRules' => ['updateExisting' => false, 'createMissing' => false, 'deleteMissing' => false],
'triggers' => ['updateExisting' => false, 'createMissing' => false, 'deleteMissing' => false],
'graphs' => ['updateExisting' => false, 'createMissing' => false, 'deleteMissing' => false],
'httptests' => ['updateExisting' => false, 'createMissing' => false, 'deleteMissing' => false],
'maps' => ['updateExisting' => false, 'createMissing' => false],
'images' => ['updateExisting' => false, 'createMissing' => false],
'mediaTypes' => ['updateExisting' => false, 'createMissing' => false],
'valueMaps' => ['updateExisting' => false, 'createMissing' => false, 'deleteMissing' => false]
];
$options += $default_options;
foreach ($default_options as $entity => $rules) {
$options[$entity] += $rules;
}
$object_options = (
$options['templateLinkage']['createMissing']
|| $options['templateLinkage']['deleteMissing']
|| $options['items']['updateExisting']
|| $options['items']['createMissing']
|| $options['items']['deleteMissing']