Ad Widget

Collapse

Installing Zabbix on Debian Etch (Testing)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gescheit
    Senior Member
    • Jul 2007
    • 156

    #16
    Zabbix server exactly installed? Check that /usr/loca/zabbix_server exist.
    And show command # dpkg -l | grep zabbix

    Comment

    • kdclaver
      Junior Member
      • Jul 2007
      • 9

      #17
      Hello,
      Thanks for your reply. I have locate zabbix-server file in /usr/local/bin
      marina:/usr/local/bin# ls
      encode_keychange ptlib-config snmpget snmptest traptoemail
      fixproc snmpbulkget snmpgetnext snmptranslate zabbix_agent
      ipf-mod.pl snmpbulkwalk snmpinform snmptrap zabbix_agentd
      mib2c snmpcheck snmpnetstat snmpusm zabbix_get
      mib2c-update snmpconf snmpset snmpvacm zabbix_sender
      net-snmp-config snmpdelta snmpstatus snmpwalk zabbix_server
      openmcu snmpdf snmptable tkmib
      marina:/usr/local/bin#

      And this is the output of dpkg -l | grep zabbix

      marina:~# dpkg -l | grep zabbix
      ii zabbix-frontend-php 1.1.4-10 software for monitoring of your servers -- p
      marina:~#

      I want to explain a new phenomena. Yesterday I try to re-install all following the wiki howto and the official document. All the installation run well until I get this error in the log file.

      marina:/usr/local/bin# cat /tmp/zabbix_server.log
      4170:20070725:073956 Starting zabbix_server. ZABBIX 1.4.1.
      4170:20070725:073956 **** Enabled features ****
      4170:20070725:073956 SNMP monitoring: YES
      4170:20070725:073956 WEB monitoring: YES
      4170:20070725:073956 Jabber notifications: YES
      4170:20070725:073956 **************************
      4170:20070725:073956 Failed to connect to database: Error: Access denied for user 'root'@'localhost' (using password: NO) [1045]
      marina:/usr/local/bin#

      Can you help me solve the connection of database problem because I can finalize the installation via http://localhost/overview

      Thanks more

      Comment

      • gescheit
        Senior Member
        • Jul 2007
        • 156

        #18
        typical install

        1 download zabbix - http://prdownloads.sourceforge.net/z...ar.gz?download
        2 Unpack zabbix-1.4.1.tar.gz to /usr/src/
        3 cd /usr/src/zabbix-1.4.1
        4 ./configure --prefix=/usr --enable-server --enable-agent --with-mysql --with-jabber --with-libcurl --with-net-snmp
        5 make && make install
        6 cd create/schema
        7 mysqladmin -p create zabbix
        8 mysql -D zabbix -p < mysql.sql
        9 cd ../data
        10 mysql -D zabbix -p < images_mysql.sql
        11 mysql -D zabbix -p < data.sql
        12 cp -R ../../frontends/php/ /var/www/zabbix
        13 mkdir /etc/zabbix
        14 cp ../../misc/conf/* /etc/zabbix/
        15 mc -e /etc/zabbix/zabbix_server.conf
        16 adduser zabbix

        like all.

        Comment

        • kdclaver
          Junior Member
          • Jul 2007
          • 9

          #19
          Thanks for your reply therefore I want to know if I must clean all the table I have in zabbix database before and after execute all the command you suggest ?

          Thanks more

          Comment

          • kdclaver
            Junior Member
            • Jul 2007
            • 9

            #20
            I have delete the last installation zabbix database and execute all the commands you suggest. Now when I try to access zabbix via web interface, I have these wranings messages on the top of the web page :
            Warning: include_once(/etc/zabbix/dbconfig.php) [function.include-once]: failed to open stream: Permission denied in /usr/share/zabbix/include/db.inc.php on line 24

            Warning: include_once() [function.include]: Failed opening '/etc/zabbix/dbconfig.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /usr/share/zabbix/include/db.inc.php on line 24

            And an this error message on the top of the login :
            [ERROR:Login name or password is incorrect]

            Comment

            • kdclaver
              Junior Member
              • Jul 2007
              • 9

              #21
              This is my zabbix_server.conf file contains :

              # This is config file for ZABBIX server process
              # To get more information about ZABBIX,
              # go http://www.zabbix.com

              ############ GENERAL PARAMETERS #################

              # This defines unique NodeID in distributed setup,
              # Default value 0 (standalone server)
              # This parameter must be between 0 and 999
              #NodeID=0

              # Number of pre-forked instances of pollers
              # Default value is 5
              # This parameter must be between 0 and 255
              #StartPollers=5

              # Number of pre-forked instances of pollers for unreachable hosts
              # Default value is 1
              # This parameter must be between 0 and 255
              #StartPollersUnreachable=1

              # Number of pre-forked instances of trappers
              # Default value is 5
              # This parameter must be between 0 and 255
              #StartTrappers=5

              # Number of pre-forked instances of ICMP pingers
              # Default value is 1
              # This parameter must be between 0 and 255
              #StartPingers=1

              # Number of pre-forked instances of discoverers
              # Default value is 1
              # This parameter must be between 0 and 255
              #StartDiscoverers=1

              # Number of pre-forked instances of HTTP pollers
              # Default value is 1
              # This parameter must be between 0 and 255
              #StartHTTPPollers=1

              # Listen port for trapper. Default port number is 10051. This parameter
              # must be between 1024 and 32767

              #ListenPort=10051

              # Listen interface for trapper. Trapper will listen all network interfaces
              # if this parameter is missing.

              #ListenIP=127.0.0.1

              # How often ZABBIX will perform housekeeping procedure
              # (in hours)
              # Default value is 1 hour
              # Housekeeping is removing unnecessary information from
              # tables history, alert, and alarms
              # This parameter must be between 1 and 24

              #HousekeepingFrequency=1

              # How often ZABBIX will try to send unsent alerts
              # (in seconds)
              # Default value is 30 seconds
              SenderFrequency=30

              # Uncomment this line to disable housekeeping procedure
              #DisableHousekeeping=1

              # Specifies debug level
              # 0 - debug is not created
              # 1 - critical information
              # 2 - error information
              # 3 - warnings (default)
              # 4 - for debugging (produces lots of information)

              DebugLevel=3

              # Specifies how long we wait for agent response (in sec)
              # Must be between 1 and 30
              Timeout=5

              # Specifies how many seconds trapper may spend processing new data
              # Must be between 1 and 30
              #TrapperTimeout=5

              # After how many seconds of unreachability treat a host as unavailable
              #UnreachablePeriod=45

              # How ofter check host for availability during the unreachability period
              #UnavailableDelay=15

              # How ofter check host for availability during the unavailability period
              #UnavailableDelay=60

              # Name of PID file

              PidFile=/var/tmp/zabbix_server.pid

              # Name of log file
              # If not set, syslog is used

              LogFile=/tmp/zabbix_server.log

              # Maximum size of log file in MB. Set to 0 to disable automatic log rotation.
              #LogFileSize=1

              # Location for custom alert scripts
              AlertScriptsPath=/home/zabbix/bin/

              # Location of external scripts
              #ExternalScripts=/etc/zabbix/externalscripts

              # Location of 'fping. Default is /usr/sbin/fping
              # Make sure that fping binary has root permissions and SUID flag set
              #FpingLocation=/usr/sbin/fping

              # Frequency of ICMP pings (item keys 'icmpping' and 'icmppingsec'). Defauls is 60 seconds.
              #PingerFrequency=60

              # Database host name
              # Default is localhost

              #DBHost=localhost

              # Database name
              # SQLite3 note: path to database file must be provided. DBUser and DBPassword are ignored.
              DBName=zabbix

              # Database user

              #DBUser=root
              DBUser=zabbix

              # Database password
              # Comment this line if no password used

              #DBPassword=<password>
              DBPassword=<zabbix_password>

              # Connect to MySQL using Unix socket?

              #DBSocket=/tmp/mysql.sock
              marina:~/zabbix-1.4.1#

              Comment

              • gescheit
                Senior Member
                • Jul 2007
                • 156

                #22
                check permission on /etc/zabbix/dbconfig.php. Apache must read this file

                Comment

                • kdclaver
                  Junior Member
                  • Jul 2007
                  • 9

                  #23
                  Thanks a lot,
                  Now I can connect as admin without password. But I have a new warning message at the top of the web page :

                  Error in query [select * from rights where userid=2] [Unknown column 'userid' in 'where clause']
                  Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /usr/share/zabbix/include/db.inc.php on line 104

                  Another thing is that when I select Monitoring or Inventory I can see " No permissions!" in red color.

                  Can you please help me solve this problem and avoid the warning.

                  Regards

                  Comment

                  • gescheit
                    Senior Member
                    • Jul 2007
                    • 156

                    #24
                    Show /usr/share/zabbix/include/db.inc.php

                    Comment

                    • kdclaver
                      Junior Member
                      • Jul 2007
                      • 9

                      #25
                      This my db.inc.php.
                      Thanks

                      marina:/usr/share/zabbix/include# cat db.inc.php
                      <?php
                      /*
                      ** ZABBIX
                      ** Copyright (C) 2000-2005 SIA Zabbix
                      **
                      ** This program is free software; you can redistribute it and/or modify
                      ** it under the terms of the GNU General Public License as published by
                      ** the Free Software Foundation; either version 2 of the License, or
                      ** (at your option) any later version.
                      **
                      ** This program is distributed in the hope that it will be useful,
                      ** but WITHOUT ANY WARRANTY; without even the implied warranty of
                      ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
                      ** GNU General Public License for more details.
                      **
                      ** You should have received a copy of the GNU General Public License
                      ** along with this program; if not, write to the Free Software
                      ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
                      **/
                      ?>
                      <?php

                      // DATABASE CONFIGURATION
                      include_once("/etc/zabbix/dbconfig.php");
                      // END OF DATABASE CONFIGURATION

                      // $USER_DETAILS ="";
                      global $USER_DETAILS;

                      if($DB_TYPE == "MYSQL")
                      {
                      $DB=mysql_pconnect($DB_SERVER,$DB_USER,$DB_PASSWOR D);
                      if(!mysql_select_db($DB_DATABASE))
                      {
                      echo "Error connecting to database [".mysql_error()."]";
                      exit;
                      }
                      mysql_select_db($DB_DATABASE);
                      }
                      if($DB_TYPE == "POSTGRESQL")
                      {
                      $DB=pg_pconnect("host='$DB_SERVER' dbname='$DB_DATABASE' user='$DB_USER' password='$DB_PASSWORD'");
                      if(!$DB)
                      {
                      echo "Error connecting to database";
                      exit;
                      }
                      }

                      function DBselect($query)
                      {
                      global $DB,$DB_TYPE;

                      // echo $query,"<br>";

                      if($DB_TYPE == "MYSQL")
                      {
                      $result=mysql_query($query,$DB);
                      if(!$result)
                      {
                      echo "Error in query [$query] [".mysql_error()."]";
                      }
                      return $result;
                      }
                      if($DB_TYPE == "POSTGRESQL")
                      {
                      $result=pg_exec($DB,$query);
                      return $result;
                      }
                      }

                      function DBexecute($query, $skip_error_messages=0)
                      {
                      global $DB,$DB_TYPE;

                      $result = FALSE;

                      if($DB_TYPE == "MYSQL")
                      {
                      $result=mysql_query($query,$DB);

                      if(!$result && $skip_error_messages==0)
                      {
                      error("SQL error: ".mysql_error());
                      error("Query: $query");
                      }
                      }
                      if($DB_TYPE == "POSTGRESQL")
                      {
                      $result=pg_exec($DB,$query);
                      }

                      //SDI("DBexecute($query) = '".$result."'");

                      return $result;
                      }

                      function DBfetch($result)
                      {
                      global $DB_TYPE;

                      if($DB_TYPE == "MYSQL")
                      {
                      $row=mysql_fetch_array($result);
                      return $row;
                      }
                      if($DB_TYPE == "POSTGRESQL")
                      {
                      $row=pg_fetch_array($result);
                      return $row;
                      }
                      return FALSE;
                      }

                      function get_field($result,$rownum,$fieldnum)
                      {
                      global $DB_TYPE;

                      if($DB_TYPE == "MYSQL")
                      {
                      mysql_data_seek($result,$rownum);
                      $row=mysql_fetch_row($result);
                      return $row[$fieldnum];
                      }
                      if($DB_TYPE == "POSTGRESQL")
                      {
                      $row=pg_fetch_row($result,$rownum);
                      if(!$row)
                      {
                      echo "Error getting row";
                      exit;
                      }
                      return $row[$fieldnum];
                      }
                      }

                      function DBnum_rows($result)
                      {
                      global $DB_TYPE;

                      if($DB_TYPE == "MYSQL")
                      {
                      return mysql_num_rows($result);
                      }
                      if($DB_TYPE == "POSTGRESQL")
                      {
                      return pg_numrows($result);
                      }
                      return 0;
                      }

                      function DBinsert_id($result,$table,$field)
                      {
                      global $DB,$DB_TYPE;

                      if($DB_TYPE == "MYSQL")
                      {
                      return mysql_insert_id($DB);
                      }

                      if($DB_TYPE == "POSTGRESQL")
                      {
                      $oid=pg_getlastoid($result);
                      // echo "OID:$oid<br>";
                      $sql="select $field from $table where oid=$oid";
                      $result=DBselect($sql);
                      return get_field($result,0,0);
                      }
                      }

                      function zbx_dbstr($var)
                      {
                      return "'".addslashes($var)."'";
                      }
                      ?>
                      marina:/usr/share/zabbix/include#

                      Comment

                      • gescheit
                        Senior Member
                        • Jul 2007
                        • 156

                        #26
                        There appears to be that the problem with MySQL. Check whether all of the all tables set up.

                        Comment

                        Working...