Source
if ($host['status'] == HOST_STATUS_MONITORED && $host['maintenance_status'] == HOST_MAINTENANCE_STATUS_ON) {
<?php declare(strict_types = 0);
/*
** Zabbix
** Copyright (C) 2001-2022 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.
**/
/**
* 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.