Ad Widget

Collapse

Database error:error connecting to database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jayshankar
    Member
    • Apr 2017
    • 31

    #1

    Database error:error connecting to database

    Hi,

    I have installed zabbix 3.2 , mysqld, php and httpd on fedora 22 linux box. Httpd, mysqld , zabbix_server and zabbix_agentd is running successfully on linux machine. Now i try to connect from the web-browser i.e http://127.0.0.1/zabbix . I get the below error

    Database error
    Error connecting to database: No such file or directory.

    I have populated values type=mysql, database=zabbix in zabbix.conf.php file in /var/www/html/zabbix/conf/zabbix directory.

    Looking forward for suggestions.



    Thanks
    Jayshankar
  • batchenr
    Senior Member
    • Sep 2016
    • 440

    #2
    Originally posted by Jayshankar
    Hi,

    I have installed zabbix 3.2 , mysqld, php and httpd on fedora 22 linux box. Httpd, mysqld , zabbix_server and zabbix_agentd is running successfully on linux machine. Now i try to connect from the web-browser i.e http://127.0.0.1/zabbix . I get the below error

    Database error
    Error connecting to database: No such file or directory.

    I have populated values type=mysql, database=zabbix in zabbix.conf.php file in /var/www/html/zabbix/conf/zabbix directory.

    Looking forward for suggestions.



    Thanks
    Jayshankar
    you need to check to which file zabbix trying to connect - try to check via
    zabbix server log
    then you can see why it doesnt find it,

    Comment

    • Jayshankar
      Member
      • Apr 2017
      • 31

      #3
      php errors on dashboard

      Hi,

      I am getting the following errors in Dashboard. My php version is 7.0. I have also set the date.timezone = Asia/Kolkata. But the error still persists.

      All suggestions appreciated.

      Thanks,
      Jayshankar



      PHP option "date.timezone" unknown Time zone for PHP is not set (configuration parameter "date.timezone").
      PHP sockets off PHP sockets extension missing (PHP configuration parameter --enable-sockets).
      PHP gd unknown PHP gd extension missing (PHP configuration parameter --with-gd).
      PHP gd PNG support off PHP gd PNG image support missing.
      PHP gd JPEG support off PHP gd JPEG image support missing.
      PHP gd FreeType support off PHP gd FreeType support missing.
      PHP gettext off PHP gettext extension missing (PHP configuration parameter --with-gettext). Translations will not be available.

      Comment

      • ovas
        Senior Member
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Apr 2017
        • 138

        #4
        Hello!

        Can you please show the contents of Zabbix virtualhost config and output of php -v, php -m and httpd -M | grep php commands?

        Comment

        • Jayshankar
          Member
          • Apr 2017
          • 31

          #5
          errors

          Output of commands are as below. I was wondering whether zabbix version 3.2 is compatible with php 7. Is there an easy way to do zabbix setup.

          *php-v*:
          PHP 7.0.17 (cli) (built: Apr 11 2017 15:50:50) ( NTS )
          Copyright (c) 1997-2017 The PHP Group
          Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies

          *php -m*

          [PHP Modules]
          bcmath
          calendar
          Core
          ctype
          curl
          date
          dom
          exif
          fileinfo
          filter
          ftp
          hash
          iconv
          json
          libxml
          mbstring
          mcrypt
          mysqli
          mysqlnd
          openssl
          pcntl
          pcre
          PDO
          pdo_mysql
          pdo_sqlite
          Phar
          posix
          Reflection
          session
          SimpleXML
          soap
          SPL
          sqlite3
          standard
          sysvmsg
          sysvsem
          sysvshm
          tokenizer
          xml
          xmlreader
          xmlwriter
          zlib

          *httpd -M | grep php*

          Syntax OK
          php7_module (shared)

          when i bring up the zabbix php pages the following errors are displayed
          on the zabbix screen

          PHP option "date.timezone" unknown Time zone for PHP is not set (configuration parameter "date.timezone").
          PHP sockets off PHP sockets extension missing (PHP configuration parameter --enable-sockets).
          PHP gd unknown PHP gd extension missing (PHP configuration parameter --with-gd).
          PHP gd PNG support off PHP gd PNG image support missing.
          PHP gd JPEG support off PHP gd JPEG image support missing.
          PHP gd FreeType support off PHP gd FreeType support missing.
          PHP gettext off PHP gettext extension missing (PHP configuration parameter --with-gettext). Translations will not be available.



          Looking forward for your reply asap.

          Thanks in advance.

          -Jayshankar

          Comment

          • Jayshankar
            Member
            • Apr 2017
            • 31

            #6
            error

            I think, the error is due to php configure command during setup. Please email me the ./configure parameters... required for setup of php 7,apache, mysql or any other suitable version(5.6..). Looking forward for your reply.

            Thanks,
            Jayshankar

            Comment

            • ovas
              Senior Member
              Zabbix Certified Trainer
              Zabbix Certified SpecialistZabbix Certified Professional
              • Apr 2017
              • 138

              #7
              Hello!

              Not exactly, as you can see from the error screen itself and PHP modules installed, you indeed miss gd, gettext and sockets extensions. Install them and see how it will go.
              The default virtualhost provided with Zabbix installation is configured for PHP 5, whereas you have PHP 7 installed. You should check your virtualhost config as well, make sure it has <IfModule mod_php7.c>...</IfModule> section enabled (default one is mod_php5).

              Comment

              • Jayshankar
                Member
                • Apr 2017
                • 31

                #8
                Zabbix

                Hi,

                How does zabbix agent and zabbix server communicate with the front end php modules. Zabbix agent measures cpu, disk and process statistics. But i didn't notice zabbix agent making use of any snmp OID's.

                To retrieve value from the zabbix front end, one has to write script in json api's. Are there api's for back end code i.e. zabbix agent and server to add fuctionality. Which module is responsible for implementing the snmp functionality. Is the backend modules or frontend implementing the snmp functionality. What functionality does the poller and trapper threads in zabbix server perform.

                Please let me know.

                Thanks,
                Jayshankar

                Comment

                • kloczek
                  Senior Member
                  • Jun 2006
                  • 1771

                  #9
                  Originally posted by Jayshankar
                  Hi,

                  How does zabbix agent and zabbix server communicate with the front end php modules. Zabbix agent measures cpu, disk and process statistics. But i didn't notice zabbix agent making use of any snmp OID's.
                  Agent does not communicate with frontend at all.
                  Server as well but frontend communicates with server.
                  All SNMP data are collected over server and proxy (if host with SNMP items is monitored over proxy data are collected over this exactly proxy).
                  http://uk.linkedin.com/pub/tomasz-k%...zko/6/940/430/
                  https://kloczek.wordpress.com/
                  zapish - Zabbix API SHell binding https://github.com/kloczek/zapish
                  My zabbix templates https://github.com/kloczek/zabbix-templates

                  Comment

                  • Jayshankar
                    Member
                    • Apr 2017
                    • 31

                    #10
                    snmp functionality and code flow

                    Hi,

                    Zabbix retrieves snmp data with snmpget system call. In the frontend i select template snmp and set the relevant community string. The network shows relevant snmp calls being sent on the wire.

                    Is inOctets and OutOctets written to database.

                    What all modules in zabbix server participate in fetching data from the network. I am trying to understand the code flow.

                    Thanks,
                    Jayshankar

                    Comment

                    • ovas
                      Senior Member
                      Zabbix Certified Trainer
                      Zabbix Certified SpecialistZabbix Certified Professional
                      • Apr 2017
                      • 138

                      #11
                      Hello Jayshankar!

                      Some of the information about internal processes is available here: http://blog.zabbix.com/monitoring-ho...esses-are/457/

                      Comment

                      • Jayshankar
                        Member
                        • Apr 2017
                        • 31

                        #12
                        ps -eLf | egrep "zabbix|UID" would provide me the same information.

                        Comment

                        • ovas
                          Senior Member
                          Zabbix Certified Trainer
                          Zabbix Certified SpecialistZabbix Certified Professional
                          • Apr 2017
                          • 138

                          #13
                          If this is not enough, it is a good time to apply for professional training, internal processes are covered on Day 1.

                          Comment

                          • Jayshankar
                            Member
                            • Apr 2017
                            • 31

                            #14
                            core dump not being generated in fedora 25 and 24

                            #include<stdio.h>
                            int main()
                            {
                            char **a;

                            printf(" jjgooo \n");
                            **a = 10;
                            printf(" %c \n",**a);

                            return 1;

                            }

                            Compilation: gcc a.c -o a -g
                            Output:
                            jjgooo
                            Segmentation fault (core dumped)
                            The core file is not being created in fedora 25. I appreciate your reply.

                            Comment

                            • Thiago Strato
                              Junior Member
                              • Nov 2017
                              • 3

                              #15
                              Originally posted by Jayshankar
                              Hi,

                              I have installed zabbix 3.2 , mysqld, php and httpd on fedora 22 linux box. Httpd, mysqld , zabbix_server and zabbix_agentd is running successfully on linux machine. Now i try to connect from the web-browser i.e http://127.0.0.1/zabbix . I get the below error

                              Database error
                              Error connecting to database: No such file or directory.

                              I have populated values type=mysql, database=zabbix in zabbix.conf.php file in /var/www/html/zabbix/conf/zabbix directory.

                              Looking forward for suggestions.



                              Thanks
                              Jayshankar
                              Hi folks, I have this problem.

                              What is the solution?

                              Comment

                              Working...