Source
discovery_port2str($dchecks[$dservice['dcheckid']]['type'], $dservice['port']).$key_.$allow_redirect;
<?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/>.
**/
/**
* A class to display discovery table as a screen element.
*/
class CScreenDiscovery extends CScreenBase {
/**
* Data
*
* @var array
*/
protected $data = [];
/**
* Init screen data.
*
* @param array $options
* @param array $options['data']
*/
public function __construct(array $options = []) {
parent::__construct($options);
$this->data = $options['data'];
}
/**
* Process screen.
*
* @return CDiv (screen inside container)
*/
public function get() {
$this->dataId = 'discovery';
$sort_field = $this->data['sort'];
$sort_order = $this->data['sortorder'];
$drules = API::DRule()->get([
'output' => ['druleid', 'name'],
'selectDHosts' => ['dhostid', 'status', 'lastup', 'lastdown'],
'druleids' => (array_key_exists('filter_druleids', $this->data) && $this->data['filter_druleids'])
? $this->data['filter_druleids']
: null,
'filter' => ['status' => DRULE_STATUS_ACTIVE],
'preservekeys' => true
]);
order_result($drules, 'name');