.
zabbix-web install script can't connect to Postgresql, but script:
<?php
error_reporting(E_ALL);
echo "test db connection";
$db_c = pg_connect("host=xx.ee.zz.13 dbname=zabbix user=zabbix password=mypass") or die ('Not connected: '. pg_last_error());
if ($db_c) {
$query = "SELECT * FROM users_groups";
$result = pg_exec($db_c, $query);
if ($result) {
for ($row = 0; $row < pg_numrows($result); $row++) {
$fn = pg_result($result, $row, 'id');
echo $fn . "<br> ";
}
} else {
echo "Query faild :". pg_errormessage($db_c);
}
} else {
echo 'Connection failed: '. pg_last_error();
}
pg_close($db_c);
?>
connected to DB and returned valid results. Question: what is happening and where to look
Zabbix 6.0.2/RHEL 8.5/Postgresql 14
<?php
error_reporting(E_ALL);
echo "test db connection";
$db_c = pg_connect("host=xx.ee.zz.13 dbname=zabbix user=zabbix password=mypass") or die ('Not connected: '. pg_last_error());
if ($db_c) {
$query = "SELECT * FROM users_groups";
$result = pg_exec($db_c, $query);
if ($result) {
for ($row = 0; $row < pg_numrows($result); $row++) {
$fn = pg_result($result, $row, 'id');
echo $fn . "<br> ";
}
} else {
echo "Query faild :". pg_errormessage($db_c);
}
} else {
echo 'Connection failed: '. pg_last_error();
}
pg_close($db_c);
?>
connected to DB and returned valid results. Question: what is happening and where to look
Zabbix 6.0.2/RHEL 8.5/Postgresql 14
Comment