Source
.zbx_dbstr($discovery_ruleids['Discovery rule for deleting, check used in Action'])
<?php
/*
** Zabbix
** 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 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.
**/
class NetworkDiscovery {
/**
* Create data for Network Discovery tests.
*
* @return array
*/
public static function load() {
// Create proxies for Discovery rule with proxy.
$proxies = CDataHelper::call('proxy.create',
[
[
'host' => 'Proxy for Network discovery',
'status' => 5
],
[
'host' => 'Proxy for Network discovery cloning',
'status' => 5
]
]
);
$proxyid = $proxies['proxyids'][0];
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
]
]
],
[
'name' => 'Disabled discovery rule for update',
'iprange' => '192.168.1.1-255',
'status' => DRULE_STATUS_DISABLED,
'dchecks' => [
[
'type' => SVC_IMAP,
'ports' => 10050
]
]
],
[
'name' => 'Discovery rule for changing checks',
'iprange' => '192.168.1.1-255',
'status' => DRULE_STATUS_DISABLED,
'dchecks' => [
[
// SNMPv1 agent.
'type' => SVC_SNMPv1,
'ports' => 161,
'key_' => '.1.3.6.1.2.1.9.9.9',
'snmp_community'=> 'test SNMP community',
'host_source' => 3,
'name_source' => 2
],
[