Ad Widget

Collapse

How i can change database pointing in Zabbix FE

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • arovah
    Member
    • Nov 2020
    • 43

    #1

    How i can change database pointing in Zabbix FE

    Dear masters,

    I want to change database zabbix pointing in Zabbix Front End from old database server to new database server. Could you tell me , how i can to change it ?
    Because i changed in file : /usr/share/zabbix/conf/zabbix.conf.php it didn't work and still connect to old database server. For database we use postgresql .
    Below my configuration :
    <?php
    // Zabbix GUI configuration file.
    global $DB, $HISTORY;

    $DB['TYPE'] = 'POSTGRESQL';
    $DB['SERVER'] = '10.14.22.227';
    $DB['PORT'] = '5758';
    $DB['DATABASE'] = 'zabbix4';
    $DB['USER'] = 'zabbix';
    $DB['PASSWORD'] = 'xxxxxxxx';
    // Schema name. Used for IBM DB2 and PostgreSQL.
    $DB['SCHEMA'] = 'zabbix';

    $ZBX_SERVER = '10.14.22.15';
    $ZBX_SERVER_PORT = '10051';
    $ZBX_SERVER_NAME = '';

    $IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;

    ?>

    Please your help and any advice.
    Thank you
  • vladimir_lv
    Senior Member
    • May 2022
    • 240

    #2
    Sorry for the stupid question but did you restart Apache (nginx)?

    Comment

    • arovah
      Member
      • Nov 2020
      • 43

      #3
      I have restart apache server too, but it didn't work.
      It still pointing in old database server. But if i change in /etc/zabbix/web/zabbix.conf.php , with same configuration above.
      It show error message : Unable to select configuration

      Comment


      • vladimir_lv
        vladimir_lv commented
        Editing a comment
        Check your zabbix_server.log for the error such connection to database 'zabbix' failed: [1045] Access denied for user...
    • tim.mooney
      Senior Member
      • Dec 2012
      • 1427

      #4
      Originally posted by arovah
      I want to change database zabbix pointing in Zabbix Front End from old database server to new database server. Could you tell me , how i can to change it ?
      Because i changed in file : /usr/share/zabbix/conf/zabbix.conf.php it didn't work and still connect to old database server. For database we use postgresql .
      You don't say what version of Zabbix you're using, whether you installed from packages, from source, via docker, or some other method, and you don't say what OS and version you're using, so without that information it's difficult to give specific recommendations.

      If you installed using the official packages from zabbix.com, that should be the correct file to change for the front end.

      If you're using the official packages and you installed the recommended way, then you're using PHP as a separate process (php-fpm), so just restarting the web server (apache httpd, nginx, lighthttpd, etc.) doesn't cause PHP to re-read the settings from that configuration file. In this case, you need to restart the PHP worker pool for zabbix, not httpd/nginx/etc.

      Since you didn't say what OS and version, this is just a guess at how you might restart all php-fpm workers:

      Code:
      systemctl restart php-fpm.service

      Comment

      • arovah
        Member
        • Nov 2020
        • 43

        #5
        thank you all for your response and advices, it already solved

        Comment

        Working...