Source
if ($host['status'] == HOST_STATUS_MONITORED && $host['maintenance_status'] == HOST_MAINTENANCE_STATUS_ON) {
<?php declare(strict_types = 0);
/*
** 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/>.
**/
/**
* Base controller for the "Monitoring->Hosts" page and the "Monitoring->Hosts" asynchronous refresh page.
*/
abstract class CControllerHost extends CController {
// Filter idx prefix.
const FILTER_IDX = 'web.monitoring.hosts';
// Filter fields default values.
const FILTER_FIELDS_DEFAULT = [
'name' => '',
'groupids' => [],
'ip' => '',
'dns' => '',
'port' => '',
'status' => -1,
'evaltype' => TAG_EVAL_TYPE_AND_OR,
'tags' => [],
'severities' => [],
'show_suppressed' => ZBX_PROBLEM_SUPPRESSED_FALSE,
'maintenance_status' => HOST_MAINTENANCE_STATUS_ON,
'page' => null,
'sort' => 'name',
'sortorder' => ZBX_SORT_UP
];
/**
* Get host list results count for passed filter.
*
* @param array $filter Filter options.
* @param string $filter['name'] Filter hosts by name.
* @param array $filter['groupids'] Filter hosts by host groups.
* @param string $filter['ip'] Filter hosts by IP.
* @param string $filter['dns'] Filter hosts by DNS.
* @param string $filter['port'] Filter hosts by port.
* @param string $filter['status'] Filter hosts by status.
* @param string $filter['evaltype'] Filter hosts by tags.
* @param string $filter['tags'] Filter hosts by tag names and values.
* @param string $filter['severities'] Filter problems on hosts by severities.
* @param string $filter['show_suppressed'] Filter suppressed problems.
* @param int $filter['maintenance_status'] Filter hosts by maintenance.
*
* @return int
*/
protected function getCount(array $filter): int {
$groupids = $filter['groupids'] ? getSubGroups($filter['groupids']) : null;