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
/*
** Zabbix
** Copyright (C) 2001-2023 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.
**/
/**
* 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;