Ad Widget

Collapse

Zabbix In Clear-Linux Docker Container Cannot Connect To Postgres Container

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mixtou
    Junior Member
    • Apr 2022
    • 3

    #1

    Zabbix In Clear-Linux Docker Container Cannot Connect To Postgres Container

    I have a linux host machine that runs arch. I have created two containers one for zabbix and one for postgres using clearlinux:base
    I would like to see how much faster and efficient is clearlinux running in docker compared to other images.
    However for some reason zabbix cannot connect to postgres container.
    In the first container i have installed nginx, phpfpm8 and zabbix 6 and have exposed port 80 to host machine.
    In the second container i have installed postgres13 and have also exposed port 5432 to host machine.
    Both containers are run as services from a docker-compose.yml file
    Using DBeaver in my host machine and after exposing ports of postgres container i can successfully connect to postgres running inside the container (changed listen_addresses = "*" in postgresql.conf)
    Also connecting to nginx container running zabbix using the command:
    Code:
     #> psql -U zabbix_user -d zabbix_db -h postgres
    i can also connect successfully to postgres running in clearlinux/postgres container
    In the next step i went to my browser and hit http://localhost:80 and loaded zabbix initial screen. So php is working correct.
    Next I tried to folllow the installatioinfrom web page to setup zabbix.
    However in the db connection section while i give the correct credentials i get error

    Cannot connect to the database.
  • mixtou
    Junior Member
    • Apr 2022
    • 3

    #2
    • Return type of CCookieSession:en($save_path, $session_name) should either be compatible with SessionHandlerInterface:en(string $path, string $name): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice [setup.php:27 → ZBase->run() → CAutoloader->loadClass() → require() in include/classes/core/CCookieSession.php:25]
    • Return type of CCookieSession::close() should either be compatible with SessionHandlerInterface::close(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice [setup.php:27 → ZBase->run() → CAutoloader->loadClass() → require() in include/classes/core/CCookieSession.php:25]
    • Return type of CCookieSession::read($session_id) should either be compatible with SessionHandlerInterface::read(string $id): string|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice [setup.php:27 → ZBase->run() → CAutoloader->loadClass() → require() in include/classes/core/CCookieSession.php:25]
    • Return type of CCookieSession::write($session_id, $session_data) should either be compatible with SessionHandlerInterface::write(string $id, string $data): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice [setup.php:27 → ZBase->run() → CAutoloader->loadClass() → require() in include/classes/core/CCookieSession.php:25]
    • Return type of CCookieSession::destroy($session_id) should either be compatible with SessionHandlerInterface::destroy(string $id): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice [setup.php:27 → ZBase->run() → CAutoloader->loadClass() → require() in include/classes/core/CCookieSession.php:25]
    • Return type of CCookieSession::gc($maxlifetime) should either be compatible with SessionHandlerInterface::gc(int $max_lifetime): int|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice [setup.php:27 → ZBase->run() → CAutoloader->loadClass() → require() in include/classes/core/CCookieSession.php:25]
    • pg_escape_string(): Automatic fetching of PostgreSQL connection is deprecated [setup.php:156 → CSetupWizard->__construct() → CSetupWizard->doAction() → CSetupWizard->dbConnect() → DBconnect() → PostgresqlDbBackend->init() → zbx_dbstr() → pg_escape_string() in include/db.inc.php:913]
    • pg_parameter_status(): Automatic fetching of PostgreSQL connection is deprecated [setup.php:156 → CSetupWizard->__construct() → CSetupWizard->doAction() → CSetupWizard->dbConnect() → DBconnect() → PostgresqlDbBackend->init() → pg_parameter_status() in include/classes/db/PostgresqlDbBackend.php:249]
    • pg_escape_string(): Automatic fetching of PostgreSQL connection is deprecated [setup.php:156 → CSetupWizard->__construct() → CSetupWizard->doAction() → CSetupWizard->dbConnect() → DBconnect() → DbBackend->checkDbVersion() → PostgresqlDbBackend->checkDbVersionTable() → zbx_dbstr() → pg_escape_string() in include/db.inc.php:913]
    • pg_escape_string(): Automatic fetching of PostgreSQL connection is deprecated [setup.php:156 → CSetupWizard->__construct() → CSetupWizard->doAction() → CSetupWizard->dbConnect() → DBconnect() → DbBackend->checkDbVersion() → PostgresqlDbBackend->checkDbVersionTable() → zbx_dbstr() → pg_escape_string() in include/db.inc.php:913]
    • pg_escape_string(): Automatic fetching of PostgreSQL connection is deprecated [setup.php:156 → CSetupWizard->__construct() → CSetupWizard->doAction() → CSetupWizard->dbConnect() → DBconnect() → DbBackend->checkDbVersion() → PostgresqlDbBackend->checkDbVersionTable() → zbx_dbstr() → pg_escape_string() in include/db.inc.php:913]
    • Unable to determine current Zabbix database version: the table "dbversion" was not found.

    Comment

    • mixtou
      Junior Member
      • Apr 2022
      • 3

      #3
      In Zabbix Container Logs I get 304 code

      zabbix-postgres-zabbix-1 | - - 02/May/2022:10:02:33 +0000 "GET /jsLoader.php" 304
      zabbix-postgres-zabbix-1 | - - 02/May/2022:10:02:33 +0000 "GET /jsLoader.php" 304

      Comment

      Working...