ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    New Zabbix install with Separate MariaDB database

    IT Discussion
    zabbix 3.0 zabbix zabbix server mariadb
    3
    25
    14.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • antonitA
      antonit
      last edited by antonit

      I am in the midst of building a Zabbix monitoring system and have run into an issue with the install.

      Since I wanted to separate the database form the actual site, there were no installation instructions. I followed the instructions to a tee, I just did the database install on a different server. Now, I can login to the database from the Zabbix server without any issues, but when it came to the initial Zabbix webpage setup (//localhost/zabbix) it can't see the database.

      I have checked the user, permissions, etc... Not sure what I have done wrong or if anyone out there has done a similar install but am officially stuck.

      Antoni

      1 Reply Last reply Reply Quote 1
      • scottalanmillerS
        scottalanmiller
        last edited by

        Have you put in the settings for it to look to the external database somewhere yet? Or is the step missing the step where you configure that part?

        1 Reply Last reply Reply Quote 1
        • antonitA
          antonit
          last edited by

          I have changed the zabbix config file to add the database in question.

          dafyreD 1 Reply Last reply Reply Quote 0
          • dafyreD
            dafyre @antonit
            last edited by

            @antonit said:

            I have changed the zabbix config file to add the database in question.

            You will also need to set the configuration in the Zabbix Web site config as well as the Zabbix Server config.

            antonitA 2 Replies Last reply Reply Quote 0
            • antonitA
              antonit @dafyre
              last edited by

              @dafyre Hmmm... maybe that's what I'm missing. Let me check.

              1 Reply Last reply Reply Quote 0
              • antonitA
                antonit @dafyre
                last edited by

                @dafyre Yes, I had already added the database parameters to the file (zabbix.conf.php) and have also done it to the zabbix_server.conf file.

                1 Reply Last reply Reply Quote 0
                • scottalanmillerS
                  scottalanmiller
                  last edited by

                  Looking at the server, zabbix-release was on version 2.4. Got that fixed.

                  1 Reply Last reply Reply Quote 0
                  • dafyreD
                    dafyre
                    last edited by

                    SSH in to your Zabbix server.

                    Are you able to mysql -u zabbixuser -p -h remotemariadb ?

                    antonitA 1 Reply Last reply Reply Quote 0
                    • antonitA
                      antonit @dafyre
                      last edited by

                      @dafyre Nope. Access denied.

                      scottalanmillerS 1 Reply Last reply Reply Quote 0
                      • scottalanmillerS
                        scottalanmiller @antonit
                        last edited by

                        @antonit said:

                        @dafyre Nope. Access denied.

                        That's the first thing, shouldn't be looking at Zabbix at all until the database is ready.

                        1 Reply Last reply Reply Quote 0
                        • scottalanmillerS
                          scottalanmiller
                          last edited by

                          Two quick notes on the zabbix.conf.php file (because I'm looking at the server).

                          One is that there was a typo and the file wasn't valid. I fixed that.

                          Second is that the host is not specified at all, so it isn't looking for the database server anywhere but locally.

                          1 Reply Last reply Reply Quote 0
                          • scottalanmillerS
                            scottalanmiller
                            last edited by

                            Here is what the file looked like...

                            $DB['DATABASE'] = 'zabbix';
                            $DB['USER'] = zabbix';
                            $DB['PASSWORD'] = 'password'
                            

                            Noting a missing quote, a missing semi-colon and a missing server name. Here is what it should look like...

                            $DB['DATABASE'] = 'zabbix';
                            $DB['USER'] = 'zabbix';
                            $DB['PASSWORD'] = 'password';
                            $DB['SERVER'] = 'maria';
                            
                            antonitA 1 Reply Last reply Reply Quote 1
                            • antonitA
                              antonit
                              last edited by

                              Correction. I can login. Mistyped the password (where's that damn post it note...)

                              1 Reply Last reply Reply Quote 0
                              • antonitA
                                antonit @scottalanmiller
                                last edited by

                                @scottalanmiller said:

                                $DB['SERVER'] = 'maria';

                                Ahhh... Wasn't sure how to put that in. Sadly, I still cannot connect 😛

                                1 Reply Last reply Reply Quote 0
                                • scottalanmillerS
                                  scottalanmiller
                                  last edited by

                                  What is the command to attempt to start the Zabbix service?

                                  antonitA 1 Reply Last reply Reply Quote 0
                                  • antonitA
                                    antonit @scottalanmiller
                                    last edited by antonit

                                    @scottalanmiller # service zabbix-server start

                                    1 Reply Last reply Reply Quote 0
                                    • scottalanmillerS
                                      scottalanmiller
                                      last edited by

                                      Feb 18 16:56:31 lab-lnx-zabbix systemd: zabbix-server.service failed.
                                      Feb 18 16:56:41 lab-lnx-zabbix systemd: zabbix-server.service holdoff time over, scheduling restart.
                                      Feb 18 16:56:41 lab-lnx-zabbix systemd: Starting Zabbix Server...
                                      Feb 18 16:56:41 lab-lnx-zabbix systemd: PID file /run/zabbix/zabbix_server.pid not readable (yet?) after start.
                                      Feb 18 16:56:41 lab-lnx-zabbix systemd: Started Zabbix Server.
                                      Feb 18 16:56:41 lab-lnx-zabbix systemd: zabbix-server.service: main process exited, code=exited, status=1/FAILURE
                                      Feb 18 16:56:41 lab-lnx-zabbix kill: Usage:
                                      Feb 18 16:56:41 lab-lnx-zabbix kill: kill [options] <pid|name> [...]
                                      Feb 18 16:56:41 lab-lnx-zabbix kill: Options:
                                      Feb 18 16:56:41 lab-lnx-zabbix kill: -a, --all              do not restrict the name-to-pid conversion to processes
                                      Feb 18 16:56:41 lab-lnx-zabbix kill: with the same uid as the present process
                                      Feb 18 16:56:41 lab-lnx-zabbix kill: -s, --signal <sig>     send specified signal
                                      Feb 18 16:56:41 lab-lnx-zabbix kill: -q, --queue <sig>      use sigqueue(2) rather than kill(2)
                                      Feb 18 16:56:41 lab-lnx-zabbix kill: -p, --pid              print pids without signaling them
                                      Feb 18 16:56:41 lab-lnx-zabbix kill: -l, --list [=<signal>] list signal names, or convert one to a name
                                      Feb 18 16:56:41 lab-lnx-zabbix kill: -L, --table            list signal names and numbers
                                      Feb 18 16:56:41 lab-lnx-zabbix kill: -h, --help     display this help and exit
                                      Feb 18 16:56:41 lab-lnx-zabbix kill: -V, --version  output version information and exit
                                      Feb 18 16:56:41 lab-lnx-zabbix kill: For more details see kill(1).
                                      Feb 18 16:56:41 lab-lnx-zabbix systemd: zabbix-server.service: control process exited, code=exited status=1
                                      Feb 18 16:56:41 lab-lnx-zabbix systemd: Unit zabbix-server.service entered failed state.
                                      Feb 18 16:56:41 lab-lnx-zabbix systemd: zabbix-server.service failed.
                                      
                                      1 Reply Last reply Reply Quote 0
                                      • scottalanmillerS
                                        scottalanmiller
                                        last edited by

                                        Here is the Zabbix log now...

                                         15247:20160218:170737.082 using configuration file: /etc/zabbix/zabbix_server.conf
                                         15247:20160218:170737.086 [Z3005] query failed: [1146] Table 'zabbix.users' doesn't exist [select userid from users limit 1]
                                         15247:20160218:170737.086 cannot use database "zabbix": database is not a Zabbix database
                                        

                                        To me, it looks like the Zabbix SQL Script has not yet been run against the database server to set up the database.

                                        1 Reply Last reply Reply Quote 0
                                        • scottalanmillerS
                                          scottalanmiller
                                          last edited by scottalanmiller

                                          Suspiciouns confirmed...

                                          MariaDB [zabbix]> show tables;
                                          Empty set (0.00 sec)
                                          
                                          1 Reply Last reply Reply Quote 0
                                          • scottalanmillerS
                                            scottalanmiller
                                            last edited by

                                            And there we go, just needed the database installed:

                                            zcat /usr/share/doc/zabbix-server-mysql-3.0.0/create.sql.gz | mysql -uzabbix -hmaria -ppassword zabbix
                                            

                                            Up and running.

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post