Source
$dErrorMsg = _s("Connection to Zabbix server \"%1\$s\" refused. Possible reasons:\n1. Incorrect \"NodeAddress\" or \"ListenPort\" in the \"zabbix_server.conf\" or server IP/DNS override in the \"zabbix.conf.php\";\n2. Security environment (for example, SELinux) is blocking the connection;\n3. Zabbix server daemon not running;\n4. Firewall is blocking TCP connection.\n", $host_port);
<?php
/*
** 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/>.
**/
/**
* A class for interacting with the Zabbix server.
*
* Class CZabbixServer
*/
class CZabbixServer {
/**
* Return item queue overview.
*/
const QUEUE_OVERVIEW = 'overview';
/**
* Return item queue overview by proxy.
*/
const QUEUE_OVERVIEW_BY_PROXY = 'overview by proxy';
/**
* Return a detailed item queue.
*/
const QUEUE_DETAILS = 'details';
/**
* Response value if the request has been executed successfully.
*/
const RESPONSE_SUCCESS = 'success';
/**
* Response value if an error occurred.
*/
const RESPONSE_FAILED = 'failed';
/**
* Auxiliary constants for request() method.
*/
const ZBX_TCP_EXPECT_HEADER = 1;
const ZBX_TCP_EXPECT_DATA = 2;
/**
* Max number of bytes to read from the response for each iteration.
*/
const READ_BYTES_LIMIT = 8192;
/**
* Zabbix server host name.
*
* @var string|null