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/>.
**/
class NetworkDiscovery {
/**
* Create data for Network Discovery tests.
*
* @return array
*/
public static function load() {
// Create proxies for Discovery rule with proxy.
CDataHelper::call('proxy.create',
[
[
'name' => 'Test Proxy',
'operating_mode' => PROXY_OPERATING_MODE_ACTIVE
],
[
'name' => 'Proxy for Network discovery',
'operating_mode' => PROXY_OPERATING_MODE_ACTIVE
],
[
'name' => 'Proxy for cloning Network discovery',
'operating_mode' => PROXY_OPERATING_MODE_ACTIVE
]
]
);
$proxyids = CDataHelper::getIds('name');
CDataHelper::call('drule.create', [
[
'name' => 'Discovery rule for update',
'iprange' => '192.168.1.1-255',
'dchecks' => [
[
'type' => SVC_IMAP,
'ports' => 10050
],
[
'type' => SVC_POP,
'ports' => 99
],
[
'type' => SVC_AGENT,
'key_' => 'system.uname',
'ports' => 10050,
'uniq' => 1
]
]