Source
<?php
/*
** 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.
**/
require_once dirname(__FILE__).'/graphs.inc.php';
require_once dirname(__FILE__).'/maps.inc.php';
require_once dirname(__FILE__).'/users.inc.php';
/**
* @param array $filter
* @param array $filter['groupids'] (optional)
* @param array $filter['exclude_groupids'] (optional)
* @param array $filter['hostids'] (optional)
* @param string $filter['problem'] (optional)
* @param array $filter['severities'] (optional)
* @param int $filter['show_suppressed'] (optional)
* @param int $filter['hide_empty_groups'] (optional)
* @param int $filter['ext_ack'] (optional)
* @param int $filter['show_opdata'] (optional)
*
* @return array
*/
function getSystemStatusData(array $filter) {
$filter_groupids = (array_key_exists('groupids', $filter) && $filter['groupids']) ? $filter['groupids'] : null;
$filter_hostids = (array_key_exists('hostids', $filter) && $filter['hostids']) ? $filter['hostids'] : null;
$filter_severities = (array_key_exists('severities', $filter) && $filter['severities'])
? $filter['severities']
: range(TRIGGER_SEVERITY_NOT_CLASSIFIED, TRIGGER_SEVERITY_COUNT - 1);
$filter_ext_ack = array_key_exists('ext_ack', $filter)
? $filter['ext_ack']
: EXTACK_OPTION_ALL;
$filter_evaltype = array_key_exists('evaltype', $filter) ? $filter['evaltype'] : TAG_EVAL_TYPE_AND_OR;
$filter_tags = array_key_exists('tags', $filter) ? $filter['tags'] : [];
$show_opdata = array_key_exists('show_opdata', $filter) && $filter['show_opdata'] != OPERATIONAL_DATA_SHOW_NONE;
if (array_key_exists('exclude_groupids', $filter) && $filter['exclude_groupids']) {
if ($filter_hostids === null) {
// Get all groups if no selected groups defined.
if ($filter_groupids === null) {
$filter_groupids = array_keys(API::HostGroup()->get([
'output' => [],
'real_hosts' => true,
'preservekeys' => true
]));
}