Ad Widget

Collapse

Zabbix new install - Unable to select configuration.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rzweeres
    Junior Member
    • Apr 2018
    • 9

    #1

    Zabbix new install - Unable to select configuration.

    Greetings Zabbix community, I am new here, as well as somewhat new to Linux.

    I've followed all instructions to get zabbix installed. Here is what I've done so far:


    Install Zabbix from Package
    Version 3.4
    OS: Debian 9
    Database MySQL (Using terminal on Debian uses MariaDB)


    I've followed all of the instructions and pretty much copy pasted all of the commands from the zabbix download page.

    When I get onto the front end via the server IP, all of the per-requisites are OK.

    I've tried using localhost, local, and server IP for the host. I've tried port 0 as well as 3306.

    Everything I try gives me the Cannot connect to the database - Unable to select configuration error.

    This is as far as I can get. All of the research I've done just brings up posts and suggestions of "Import the database sql" which doesn't sound english to me. Can anyone wak me through what I need to do to continue? I was hoping the main page instructions would at least get me up and running to a point I can fiddle with it.

    Thank you.
  • aigars.kadikis
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Mar 2018
    • 208

    #2
    Hi, rzweeres!

    Take a look if you have any password generated for zabbix database user:
    Code:
    grep "^DBPassword" /etc/zabbix/zabbix_server.conf
    Try to list existing databases:
    Code:
    mysql -h localhost -u zabbix -p -P 3306 -s <<< 'show databases;'
    If you succeed then continue with table listing:
    Code:
    mysql -h localhost -u zabbix -p -P 3306 -s <<< 'use zabbix; show tables;'
    Regards,
    Aigars

    Comment

    • rzweeres
      Junior Member
      • Apr 2018
      • 9

      #3
      Originally posted by aigars.kadikis
      Hi, rzweeres!

      Take a look if you have any password generated for zabbix database user:
      Code:
      grep "^DBPassword" /etc/zabbix/zabbix_server.conf
      Try to list existing databases:
      Code:
      mysql -h localhost -u zabbix -p -P 3306 -s <<< 'show databases;'
      If you succeed then continue with table listing:
      Code:
      mysql -h localhost -u zabbix -p -P 3306 -s <<< 'use zabbix; show tables;'
      Regards,
      Aigars
      aigars, Thank you for the reply. I have tried those 3 commands to see what would show.

      First one doesn't show anything and just goes to the next line. second one shows:
      information schema
      zabbix

      table listing lists a bunch of tables.

      How do i setup the DBpassword?

      Thanks again


      EDIT:
      Okay, I've updated the DBPassword in the conf file by using nano to edit. Still same result.
      Last edited by rzweeres; 13-04-2018, 16:02.

      Comment

      • aigars.kadikis
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Mar 2018
        • 208

        #4
        It looks like you have passwordless connection to database. Did my second and third command asked you for password?

        What is the output of this?
        Code:
        mysql -h localhost -u zabbix -p -P 3306 -s <<< 'show grants;'
        Please show what zabbix packages you have installed
        Code:
        dpkg-query -l | grep zabbix

        Comment

        • rzweeres
          Junior Member
          • Apr 2018
          • 9

          #5
          Originally posted by aigars.kadikis
          It looks like you have passwordless connection to database. Did my second and third command asked you for password?

          What is the output of this?
          Code:
          mysql -h localhost -u zabbix -p -P 3306 -s <<< 'show grants;'
          Please show what zabbix packages you have installed
          Code:
          dpkg-query -l | grep zabbix
          2nd and third commands both asked me for my password which I setup.

          show grants gave me: ERROR 1045 (28000) access denied for user zabbix@localhost (using password: YES)

          dpkg grep gave me these 4 lines.
          ii zabbix-agent 1:3.4.8-1+stretch amd64 Zabbix network monitoring solution - agent
          ii zabbix-frontend-php 1:3.4.8-1+stretch all Zabbix network monitoring solution - PHP front-end
          ii zabbix-release 3.4-1+stretch all Zabbix official repository configuration
          ii zabbix-server-mysql 1:3.4.8-1+stretch amd64 Zabbix network monitoring solution - server (MySQL)

          Thanks

          Comment

          • aigars.kadikis
            Senior Member
            Zabbix Certified SpecialistZabbix Certified Professional
            • Mar 2018
            • 208

            #6
            Hi, rzweeres!

            Am I correct that you followed this instruction?:
            Zabbix is being downloaded over 4 000 000 times every year for a reason. Download and install Zabbix for free and try it yourself!


            Please show output of this command:
            Code:
            ls -1 /usr/share/doc/zabbix-server-mysql*/
            Regards,

            Comment

            • rzweeres
              Junior Member
              • Apr 2018
              • 9

              #7
              Originally posted by aigars.kadikis
              Hi, rzweeres!

              Am I correct that you followed this instruction?:
              Zabbix is being downloaded over 4 000 000 times every year for a reason. Download and install Zabbix for free and try it yourself!


              Please show output of this command:
              Code:
              ls -1 /usr/share/doc/zabbix-server-mysql*/
              Regards,
              Yes, I followed those instructions from the download page. Here is my output:
              Code:
              changelog.Debian.gz
              changelog.gz
              copyright
              create.sql.gz
              All 4 except for 'copyright' is in red test.

              Comment

              • aigars.kadikis
                Senior Member
                Zabbix Certified SpecialistZabbix Certified Professional
                • Mar 2018
                • 208

                #8
                I would suggest to drop existing database and recreate it again. Make sure you have enough disk space berfore continue

                Ensure zabbix-server service is not running:
                Code:
                systemctl stop zabbix-server
                systemctl status zabbix-server
                Enter MySQL mode
                Code:
                mysql -uroot -p
                #enter password for MySQL user 'root'
                Code:
                show databases;
                drop database zabbix;
                create database zabbix character set utf8 collate utf8_bin;
                grant all privileges on zabbix.* to zabbix@localhost identified by 'ZpcBMdhntW9X7eEw';
                quit;
                set DBPassword in /etc/zabbix/zabbix_server.conf
                Code:
                DBPassword=ZpcBMdhntW9X7eEw
                Start zabbix-server:
                Code:
                systemctl start zabbix-server
                make sure service is running:
                Code:
                systemctl status zabbix-server
                check if log file has generated some content and it is clear from any errors or warnings:
                Code:
                cat /var/log/zabbix_server.log
                Please share some output from your terminal. Let's continue with frontend setup if you got nice content in 'zabbix_server.log'

                Regards,

                Comment

                • rzweeres
                  Junior Member
                  • Apr 2018
                  • 9

                  #9
                  Originally posted by aigars.kadikis
                  I would suggest to drop existing database and recreate it again. Make sure you have enough disk space berfore continue

                  Ensure zabbix-server service is not running:
                  Code:
                  systemctl stop zabbix-server
                  systemctl status zabbix-server
                  Enter MySQL mode
                  Code:
                  mysql -uroot -p
                  #enter password for MySQL user 'root'
                  Code:
                  show databases;
                  drop database zabbix;
                  create database zabbix character set utf8 collate utf8_bin;
                  grant all privileges on zabbix.* to zabbix@localhost identified by 'ZpcBMdhntW9X7eEw';
                  quit;
                  set DBPassword in /etc/zabbix/zabbix_server.conf
                  Code:
                  DBPassword=ZpcBMdhntW9X7eEw
                  Start zabbix-server:
                  Code:
                  systemctl start zabbix-server
                  make sure service is running:
                  Code:
                  systemctl status zabbix-server
                  check if log file has generated some content and it is clear from any errors or warnings:
                  Code:
                  cat /var/log/zabbix_server.log
                  Please share some output from your terminal. Let's continue with frontend setup if you got nice content in 'zabbix_server.log'

                  Regards,
                  Followed all of your instructions, and i get a different error now.
                  Cannot connect to the database.
                  Details
                  • The frontend does not match Zabbix database.


                  The output from the server.log just says no such file or directory

                  Gosh I <3 Linux

                  Comment

                  • aigars.kadikis
                    Senior Member
                    Zabbix Certified SpecialistZabbix Certified Professional
                    • Mar 2018
                    • 208

                    #10
                    Originally posted by rzweeres

                    Followed all of your instructions, and i get a different error now.
                    Cannot connect to the database.
                    Details
                    • The frontend does not match Zabbix database.


                    The output from the server.log just says no such file or directory

                    Gosh I <3 Linux
                    Sorry, i think i mistyped the log dir. Please try:
                    Code:
                    cat /var/log/zabbix/zabbix_server.log

                    Comment

                    • rzweeres
                      Junior Member
                      • Apr 2018
                      • 9

                      #11
                      Originally posted by aigars.kadikis

                      Sorry, i think i mistyped the log dir. Please try:
                      Code:
                      cat /var/log/zabbix/zabbix_server.log
                      Well, Tried that and I got a bunch of output of the following:
                      Code:
                      21289:20180419:084929.783 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: NO)
                       21289:20180419:084929.783 database is down: reconnecting in 10 seconds
                      It's not asking me for a password to input to see the data, although I am in root mode.
                      Even navigating through the files it won't let me open it in text editor to see it.

                      Comment

                      • aigars.kadikis
                        Senior Member
                        Zabbix Certified SpecialistZabbix Certified Professional
                        • Mar 2018
                        • 208

                        #12
                        Originally posted by rzweeres

                        Well, Tried that and I got a bunch of output of the following:
                        Code:
                        21289:20180419:084929.783 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: NO)
                        21289:20180419:084929.783 database is down: reconnecting in 10 seconds
                        It's not asking me for a password to input to see the data, although I am in root mode.
                        Even navigating through the files it won't let me open it in text editor to see it.
                        Ohh, yes! Finaly some output

                        zabbix-server service cannot connect to database. And the log file says that service is not using any password.

                        Please try to tell zabbix server what is the password for mysql user 'zabbix'. You can locate zabbix_server.conf with
                        Code:
                        find / -name zabbix_server.conf
                        Open the file and look for
                        Code:
                        # DBPassword=
                        and modify to
                        Code:
                        DBPassword=ZpcBMdhntW9X7eEw
                        Remember to remove hashtag from begining of DBPassword

                        save the file and restart zabbix service:
                        Code:
                        systemctl restart zabbix-server
                        please show again log:
                        Code:
                        cat /var/log/zabbix/zabbix_server.log

                        Comment

                        • rzweeres
                          Junior Member
                          • Apr 2018
                          • 9

                          #13
                          Originally posted by aigars.kadikis

                          Ohh, yes! Finaly some output

                          zabbix-server service cannot connect to database. And the log file says that service is not using any password.

                          Please try to tell zabbix server what is the password for mysql user 'zabbix'. You can locate zabbix_server.conf with
                          Code:
                          find / -name zabbix_server.conf
                          Open the file and look for
                          Code:
                          # DBPassword=
                          and modify to
                          Code:
                          DBPassword=ZpcBMdhntW9X7eEw
                          Remember to remove hashtag from begining of DBPassword

                          save the file and restart zabbix service:
                          Code:
                          systemctl restart zabbix-server
                          please show again log:
                          Code:
                          cat /var/log/zabbix/zabbix_server.log
                          Just gets weirder and weirder.
                          Code:
                          26351:20180419:142056.931 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: NO)
                           26351:20180419:142056.931 Cannot connect to the database. Exiting...
                           26489:20180419:142056.957 Starting Zabbix Server. Zabbix 3.4.8 (revision 79252).
                           26489:20180419:142056.957 ****** Enabled features ******
                           26489:20180419:142056.957 SNMP monitoring:           YES
                           26489:20180419:142056.957 IPMI monitoring:           YES
                           26489:20180419:142056.958 Web monitoring:            YES
                           26489:20180419:142056.958 VMware monitoring:         YES
                           26489:20180419:142056.958 SMTP authentication:       YES
                           26489:20180419:142056.958 Jabber notifications:      YES
                           26489:20180419:142056.958 Ez Texting notifications:  YES
                           26489:20180419:142056.958 ODBC:                      YES
                           26489:20180419:142056.958 SSH2 support:              YES
                           26489:20180419:142056.958 IPv6 support:              YES
                           26489:20180419:142056.958 TLS support:               YES
                           26489:20180419:142056.958 ******************************
                           26489:20180419:142056.958 using configuration file: /etc/zabbix/zabbix_server.conf
                           26489:20180419:142056.974 [Z3005] query failed: [1146] Table 'zabbix.users' doesn't exist [select userid from users limit 1]
                           26489:20180419:142056.974 cannot use database "zabbix": database is not a Zabbix database
                          I changed the password in the conf file to the one you typed out, and granted all privileges.

                          I removed the hashtag as instructed this time.
                          This is my config area, am I missing any other comments to remove?
                          Code:
                          DBUser=zabbix
                          
                          ### Option: DBPassword
                          #    Database password. Ignored for SQLite.
                          #    Comment this line if no password is used.
                          #
                          # Mandatory: yes
                          # Default:
                          DBPassword=ZpcBMdhntW9X7eEw

                          Comment


                          • Atsushi
                            Atsushi commented
                            Editing a comment
                            Please try entering the initial data.

                            zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uroot zabbix
                        • aigars.kadikis
                          Senior Member
                          Zabbix Certified SpecialistZabbix Certified Professional
                          • Mar 2018
                          • 208

                          #14
                          Originally posted by rzweeres

                          Just gets weirder and weirder.
                          Code:
                          26351:20180419:142056.931 [Z3001] connection to database 'zabbix' failed: [1045] Access denied for user 'zabbix'@'localhost' (using password: NO)
                          26351:20180419:142056.931 Cannot connect to the database. Exiting...
                          26489:20180419:142056.957 Starting Zabbix Server. Zabbix 3.4.8 (revision 79252).
                          26489:20180419:142056.957 ****** Enabled features ******
                          26489:20180419:142056.957 SNMP monitoring: YES
                          26489:20180419:142056.957 IPMI monitoring: YES
                          26489:20180419:142056.958 Web monitoring: YES
                          26489:20180419:142056.958 VMware monitoring: YES
                          26489:20180419:142056.958 SMTP authentication: YES
                          26489:20180419:142056.958 Jabber notifications: YES
                          26489:20180419:142056.958 Ez Texting notifications: YES
                          26489:20180419:142056.958 ODBC: YES
                          26489:20180419:142056.958 SSH2 support: YES
                          26489:20180419:142056.958 IPv6 support: YES
                          26489:20180419:142056.958 TLS support: YES
                          26489:20180419:142056.958 ******************************
                          26489:20180419:142056.958 using configuration file: /etc/zabbix/zabbix_server.conf
                          26489:20180419:142056.974 [Z3005] query failed: [1146] Table 'zabbix.users' doesn't exist [select userid from users limit 1]
                          26489:20180419:142056.974 cannot use database "zabbix": database is not a Zabbix database
                          I changed the password in the conf file to the one you typed out, and granted all privileges.

                          I removed the hashtag as instructed this time.
                          This is my config area, am I missing any other comments to remove?
                          Code:
                          DBUser=zabbix
                          
                          ### Option: DBPassword
                          # Database password. Ignored for SQLite.
                          # Comment this line if no password is used.
                          #
                          # Mandatory: yes
                          # Default:
                          DBPassword=ZpcBMdhntW9X7eEw
                          Now it is very good. zabbix-server service really communicates now with database . But I missed to instruct you to create database. Here is how to fix it:
                          Code:
                          systemctl stop zabbix-server
                          zcat /usr/share/doc/zabbix-server-mysql-*/create.sql.gz | mysql -uzabbix -pZpcBMdhntW9X7eEw zabbix
                          systemctl start zabbix-server
                          cat /var/log/zabbix/zabbix_server.log
                          What the log file now says?

                          Comment

                          • rzweeres
                            Junior Member
                            • Apr 2018
                            • 9

                            #15
                            Originally posted by aigars.kadikis

                            Now it is very good. zabbix-server service really communicates now with database . But I missed to instruct you to create database. Here is how to fix it:
                            Code:
                            systemctl stop zabbix-server
                            zcat /usr/share/doc/zabbix-server-mysql-*/create.sql.gz | mysql -uzabbix -pZpcBMdhntW9X7eEw zabbix
                            systemctl start zabbix-server
                            cat /var/log/zabbix/zabbix_server.log
                            What the log file now says?
                            I got a BUNCH of Cannot find module, and Cannot adopt OID lines. But with that being said I was able to complete the Setup process!!!!! So I think that is good news! If I am missing something else please let me know.

                            Upon logging in I see a bunch of empty boxes I need to configure, and this status box;

                            Code:
                             [h=4]Status of Zabbix[/h][LIST][*][/LIST][TABLE="class: list-table"]
                            [TR]
                            Parameter 			Value 			Details 		[/TR]
                            [TR]
                            [TD]Zabbix server is running[/TD]
                             			[TD]Yes[/TD]
                             			[TD]localhost:10051[/TD]
                             		[/TR]
                            [TR]
                            [TD]Number of hosts (enabled/disabled/templates)[/TD]
                             			[TD]76[/TD]
                             			[TD]0 / 1 / 75[/TD]
                             		[/TR]
                            [TR]
                            [TD]Number of items (enabled/disabled/not supported)[/TD]
                             			[TD]68[/TD]
                             			[TD]0 / 68 / 0[/TD]
                             		[/TR]
                            [TR]
                            [TD]Number of triggers (enabled/disabled [problem/ok])[/TD]
                             			[TD]46[/TD]
                             			[TD]0 / 46 [0 / 0][/TD]
                             		[/TR]
                            [TR]
                            [TD]Number of users (online)[/TD]
                             			[TD]2[/TD]
                             			[TD]2[/TD]
                             		[/TR]
                            [TR]
                            [TD]Required server performance, new values per second[/TD]
                             			[TD]0[/TD]
                             			[TD][/TD]
                             		[/TR]
                            [/TABLE]
                            Time to start fiddling with settings now... Might have to find a reference of example how to set things up

                            Thank you so much!!!
                            If you know of any links to guides for setting up different monitoring and graphs let me know, and I appreciate it a LOT!
                            <3

                            Comment

                            Working...