Ad Widget

Collapse

1.6.2: scripts not working on maps (ZBX_* vars not create in conf/zabbix.php.conf?)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Elfito
    Junior Member
    • Nov 2008
    • 4

    #1

    1.6.2: scripts not working on maps (ZBX_* vars not create in conf/zabbix.php.conf?)

    Hi all,

    I'm receiving the following error when executing scripts on maps:

    socket_connect() [<a href='function.socket-connect'>function.socket-connect</a>]: Host lookup failed [-10001]: Unknown host[/usr/share/zabbix/include/scripts.inc.php:76]
    Cannot connect to ZABBIX server [:] [Unknown host]

    I found out main problem comes because ZBX_SERVER and ZBX_SERVER_PORT is not defined when script.inc.php is executed. I'm using zabbix 1.6.2 installed from Debian official repositories. There is another post in the forums that seems to be a workaround:



    *but* Alexei does not specify if this is a bug or not. My installation of zabbix 1.6 does not contain ZBX_SERVER and ZBX_SERVER_PORT in conf/zabbix.conf.php. It contains some DB_* vars.

    Therefore, the questions are:
    • Is this file generated in a wrong way?
    • Why ZBX_* vars are not included in this file? bug?


    Here is my conf/zabbix.conf.php, just for your reference. As you can see, there are $DB_ vars created, but none of them is ZBX_*:

    =====================================
    <?php
    $DB_TYPE='mysql';
    $DB_SERVER='localhost';
    $DB_DATABASE='zabbix_database';
    $DB_USER='zabbix_user';
    $DB_PASSWORD='XXXXXXX';

    ## dont remove this!
    ## This is a work-around for dbconfig-common
    if($DB_TYPE == "mysql")
    $DB_TYPE = "MYSQL";

    if($DB_TYPE == "pgsql")
    $DB_TYPE = "POSTGRESQL";
    ##
    ?>
    =====================================

    I would really appreciate your help!! I would open a bug if other users confirm this behaviour.

    Thanks in advance
    Last edited by Elfito; 24-01-2009, 14:23.
  • Aly
    ZABBIX developer
    • May 2007
    • 1126

    #2
    This file is not created by zabbix installation wizard... which should look like this:
    Code:
    <?php
    
    global $DB;
    
    $DB["TYPE"]		= "MYSQL";
    $DB["SERVER"]		= "127.0.0.1";
    $DB["PORT"]		= "0";
    $DB["DATABASE"]		= "dbname";
    $DB["USER"]		= "user";
    $DB["PASSWORD"]		= "pass";
    $ZBX_SERVER		= "127.0.0.1";
    $ZBX_SERVER_PORT	= "10051";
    
    
    $IMAGE_FORMAT_DEFAULT	= IMAGE_FORMAT_PNG;
    ?>
    Zabbix | ex GUI developer

    Comment

    • Elfito
      Junior Member
      • Nov 2008
      • 4

      #3
      Hi all,

      It seems that Debian default configuration file for zabbix is not the one that Zabbix mainstream is using.


      However, Zabbix is still working without defining $IMAGE_FORMAT_DEFAULT and using $DB_* vars instead of $DB[*]. Source php code seems to be the same, though ()

      Therefore, I've checked the source code and find you can also define this vars as $DB_*, but perhaps they are still there for compatibility reasons for older version of zabbix.

      Aly (or any of the zabbix developers), are my suspicious right? What is your opinion about that?

      Thanks.

      Comment

      • Aly
        ZABBIX developer
        • May 2007
        • 1126

        #4
        Originally posted by Elfito
        ... but perhaps they are still there for compatibility reasons for older version of zabbix.
        Exactly
        Zabbix | ex GUI developer

        Comment

        Working...