Ad Widget

Collapse

Zabbix Setup: Configure DB connection

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • omastroi
    Junior Member
    • Apr 2013
    • 5

    #1

    Zabbix Setup: Configure DB connection

    Hello,

    I have installed Zabbix and all required software. I am currently trying to configure Zabbix with pgsql. During the setup screen there is no Database type listed for the "Zabbix Setup: Configure DB connection" portion. I am not sure why it does not detect my "pgsql".

    Any help will be appreciated.

    Thanks,
    Tony
  • tchjts1
    Senior Member
    • May 2008
    • 1605

    #2
    Not sure why it isn't finding it, but there may be a manual workaround for that.

    When you click through the Zabbix setup, it is basically creating the file called zabbix.conf.php
    which you then put in /var/www/html/zabbix/conf (or whatever your directory structure is for the frontend) and it consists of the below, and you can see where the DB type is defined. I don't know what the definition is for pgsql. Maybe "PSSQL" or "POSTGRES"

    Code:
    <?php
    // Zabbix GUI configuration file
    global $DB;
    
    $DB["TYPE"]                             = 'MYSQL';
    $DB["SERVER"]                   = 'zabbix.server.ip.here';
    $DB["PORT"]                             = '0';
    $DB["DATABASE"]                 = 'zabbix';
    $DB["USER"]                             = 'zabbix';
    $DB["PASSWORD"]                 = 'DB password here';
    // SCHEMA is relevant only for IBM_DB2 database
    $DB["SCHEMA"]                   = '';
    
    $ZBX_SERVER                             = 'zabbix.server.ip.here';
    $ZBX_SERVER_PORT                = '10051';
    $ZBX_SERVER_NAME                = 'Zabbix 2.0.6 PROD'; <-- Any name you want here
    
    $IMAGE_FORMAT_DEFAULT   = IMAGE_FORMAT_PNG;
    ?>

    Comment

    • omastroi
      Junior Member
      • Apr 2013
      • 5

      #3
      Hi tchjts1,

      Thank you for the reply. I tried to edit that file a few times with no luck. Do I need to restart Zabbix Server/Agent after I modify the file? Do I need to restart Apache?

      Thanks,
      Tony

      Comment

      • tchjts1
        Senior Member
        • May 2008
        • 1605

        #4
        Originally posted by omastroi
        Hi tchjts1,

        Thank you for the reply. I tried to edit that file a few times with no luck. Do I need to restart Zabbix Server/Agent after I modify the file? Do I need to restart Apache?

        Thanks,
        Tony
        I would restart Apache just to be sure. if Zabbix server is running, I would restart that as well. Someone that runs PS DB should chime in and tell you the syntax that is in their zabbix.conf.php file.

        If you have that file in the correct directory, and it has the correct permissions, I don't think you need to click through the GUI setup. At least back in the 1.6.x and 1.8.x days I don't recall having to click through if I used the manual file creation.

        With that said, it may be worthwhile to put that file in place and then try to click through again.

        Comment

        • omastroi
          Junior Member
          • Apr 2013
          • 5

          #5
          Hi tchjts1,

          I just noticed that any changes I make to that file does not get picked up. My Apache DocumentRoot is defined in "/public_html/htdocs/" therefore I placed "zabbix.conf.php" file in the following location "/public_html/htdocs/zabbix/conf".

          When I look at "setup.php" I don't see a call for "zabbix.conf.php". Is this the correct file name?

          Thanks,
          Tony

          Comment

          • tchjts1
            Senior Member
            • May 2008
            • 1605

            #6
            Indeed it is:

            Mine is here.
            /var/www/html/zabbix/conf/zabbix.conf.php

            [root@:/var/www/html/zabbix/conf]
            # ls -l
            total 12
            -rwxr-xr-x. 1 zabbix zabbix 1046 Apr 22 10:05 maintenance.inc.php
            -rwxr-xr-x. 1 zabbix zabbix 632 Apr 22 15:44 zabbix.conf.php
            -rwxr-xr-x. 1 zabbix zabbix 427 Apr 22 10:05 zabbix.conf.php.example


            When you successfully click through the Zabbix setup in the web interface, that is the file that gets generated at the end. You then save it to your local machine and FTP it up to your Zabbix server and put it in the proper location.

            Comment

            • omastroi
              Junior Member
              • Apr 2013
              • 5

              #7
              Hi tchjts1,

              Thanks for all the help. I got the page to finally accept the changes, but now I believe I have a compatibly issues between PHP and PostgresSQL. This may be the root of the problem.

              I get the following error when I examine the Apache error_log "Call to undefined function pg_connect() in /public_html/htdocs/zabbix/include/db.inc.php on line 99".

              Tony

              Comment

              • tchjts1
                Senior Member
                • May 2008
                • 1605

                #8
                I can't offer you any help there. I use MySql.

                What version of PHP and Apache are you using?
                My PHP version is 5.3.3 and Apache is 2.2.15

                But again... I am on MySql.

                May be worth posting a new thread with a title something like "Postgres and Apache issue". That may get the attention of some of the PSSQL users.

                Comment

                • omastroi
                  Junior Member
                  • Apr 2013
                  • 5

                  #9
                  Hi tchjts1,

                  I am running the following on AIX6.1:
                  Apache 2.2.21
                  PostgresSQL 9.2.3
                  PHP 5.3.23

                  What version of MySQL are you running? Did you install on AIX?

                  Tony

                  Comment

                  • tchjts1
                    Senior Member
                    • May 2008
                    • 1605

                    #10
                    Wow. You have to be one of the very few people running Zabbix server on AIX !!

                    At my last place of employment, we had a lot of AIX hosts we had to monitor... what a headache that was. I had so many custom compiled agents because of all the minor kernel differences, even in the sub-versions of AIX.

                    I run Zabbix infrastructure on Linux RedHat. The majority of folks run the Zabbix server on Linux.

                    MySql version is 5.1.61 for me.

                    Comment

                    • Zcynn
                      Junior Member
                      • Jun 2019
                      • 1

                      #11
                      Hi,
                      Configuring zabbix frontend i ran into this problem, found a solution and wanted to share it. So basically, you have to install a postgresql php extension in the server for zabbix frontend installation to detect postgresql.

                      The command to install the extension (for Ubuntu) was:

                      Code:
                       
                       apt-get install php-pgsql
                      You have to restart apache service after installation. Hope this could help someone with the same problem

                      Comment

                      Working...