Source
timeUnitToSeconds(CSettingsHelper::get(CSettingsHelper::CONNECT_TIMEOUT)), 15, ZBX_SOCKET_BYTES_LIMIT
<?php declare(strict_types = 1);
/*
** 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.
**/
/**
* Class collecting various system information aspects.
*/
class CSystemInfoHelper {
/**
* Prepare data used to compile as System information.
*
* @return array
*
* @throws APIException
*/
public static function getData(): array {
global $DB, $ZBX_SERVER, $ZBX_SERVER_PORT;
$data = [
'status' => static::getServerStatus($ZBX_SERVER, (int) $ZBX_SERVER_PORT),
'server_details' => '',
'failover_delay' => 0,
'float_double_precision' => $DB['DOUBLE_IEEE754']
];
$db_backend = DB::getDbBackend();
$data['encoding_warning'] = $db_backend->checkEncoding() ? '' : $db_backend->getWarning();
$dbversion_status = CSettingsHelper::getGlobal(CSettingsHelper::DBVERSION_STATUS);
if ($dbversion_status !== null && $dbversion_status !== '') {
$dbversion_status = json_decode($dbversion_status, true);
if (array_key_exists('history_pk', $dbversion_status)) {
$data['history_pk'] = ($dbversion_status['history_pk'] == 1);
}
}
else {
$dbversion_status = [];
}
$ha_cluster_enabled = false;
$ha_nodes = API::getApiService('hanode')->get([
'output' => ['name', 'address', 'port', 'lastaccess', 'status'],