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__).'/include/config.inc.php';
require_once dirname(__FILE__).'/include/items.inc.php';
$page['title'] = _('Queue');
$page['file'] = 'queue.php';
define('ZBX_PAGE_DO_REFRESH', 1);
require_once dirname(__FILE__).'/include/page_header.php';
$queueModes = [
QUEUE_OVERVIEW,
QUEUE_OVERVIEW_BY_PROXY,
QUEUE_DETAILS
];
// VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION
$fields = [
'config' => [T_ZBX_INT, O_OPT, P_SYS, IN($queueModes), null]
];
check_fields($fields);
$config = getRequest('config', CProfile::get('web.queue.config', 0));
CProfile::update('web.queue.config', $config, PROFILE_TYPE_INT);
// fetch data
$zabbixServer = new CZabbixServer($ZBX_SERVER, $ZBX_SERVER_PORT, ZBX_SOCKET_TIMEOUT, ZBX_SOCKET_BYTES_LIMIT);
$queueRequests = [
QUEUE_OVERVIEW => CZabbixServer::QUEUE_OVERVIEW,
QUEUE_OVERVIEW_BY_PROXY => CZabbixServer::QUEUE_OVERVIEW_BY_PROXY,
QUEUE_DETAILS => CZabbixServer::QUEUE_DETAILS
];
$queueData = $zabbixServer->getQueue($queueRequests[$config], get_cookie(ZBX_SESSION_NAME), QUEUE_DETAIL_ITEM_COUNT);
// check for errors error
if ($zabbixServer->getError()) {
error($zabbixServer->getError());
show_error_message(_('Cannot display item queue.'));
}
$submenu_source = [