Ad Widget

Collapse

Failed to start Zabbix Server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • azav8or
    Junior Member
    • Oct 2017
    • 9

    #1

    Failed to start Zabbix Server

    Hello all,

    First off just wanted to say my linux is very rusty and I am brand new to Zabbix. I liked what I read and saw so I decided to install Ubuntu server 17.10 and then I started to install Zabbix 3.4 but that wasn't working so I went with 3.2.
    I am at the part of starting Apache and the Zabbis server service but the service is failing.
    This is what I see:
    root@Zabbix:/etc/zabbix# ll
    total 88
    drwxr-xr-x 4 root root 4096 Oct 29 18:00 ./
    drwxr-xr-x 136 root root 12288 Oct 29 16:52 ../
    -rw-r--r-- 1 root root 1585 Oct 29 17:24 apache.conf
    drwxr-xr-x 2 www-data root 4096 Oct 18 16:31 web/
    -rw-r--r-- 1 root root 10347 Oct 18 16:31 zabbix_agentd.conf
    drwxr-xr-x 2 root root 4096 Oct 29 17:00 zabbix_agentd.d/
    -rw-r--r-- 1 root root 14916 Oct 29 17:55 zabbix_server.conf
    -rw-r--r-- 1 root root 14890 Oct 18 16:31 zabbix_server.conf.dpkg-dist
    -rw-r--r-- 1 root root 16384 Oct 29 18:00 .zabbix_server.conf.swp

    root@Zabbix:/etc/zabbix# systemctl status zabbix-server.service
    ● zabbix-server.service - Zabbix Server
    Loaded: loaded (/lib/systemd/system/zabbix-server.service; disabled; vendor preset: enabled)
    Active: activating (auto-restart) (Result: exit-code) since Sun 2017-10-29 18:13:28 MST; 937ms ago
    Process: 5302 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=1/FAILURE)
    CPU: 17ms

    Oct 29 18:13:28 Zabbix systemd[1]: zabbix-server.service: Control process exited, code=exited status=1
    Oct 29 18:13:28 Zabbix systemd[1]: Failed to start Zabbix Server.
    Oct 29 18:13:28 Zabbix systemd[1]: zabbix-server.service: Unit entered failed state.
    Oct 29 18:13:28 Zabbix systemd[1]: zabbix-server.service: Failed with result 'exit-code'.
    root@Zabbix:/etc/zabbix#
  • kaspars.mednis
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Oct 2017
    • 349

    #2
    I suggest looking at /var/log/zabbix/zabbix_server.log

    there you can find a lot of usefull information about zabbix server failures

    Regards,
    Kaspars

    Comment

    • azav8or
      Junior Member
      • Oct 2017
      • 9

      #3
      This is the entire log. It's not very big since it's never ran. I see it says cannot use database "zabbixdb": database is not a Zabbix database
      [Z3005] query failed: [1146] Table 'zabbixdb.users' doesn't exist [select userid from users limit 1]
      13714:20171029:165512.416 cannot use database "zabbixdb": database is not a Zabbix database

      6788:20171029:161447.203 Starting Zabbix Server. Zabbix 3.0.7 (revision 64609).
      6788:20171029:161447.203 ****** Enabled features ******
      6788:20171029:161447.203 SNMP monitoring: YES
      6788:20171029:161447.203 IPMI monitoring: YES
      6788:20171029:161447.203 Web monitoring: YES
      6788:20171029:161447.203 VMware monitoring: YES
      6788:20171029:161447.203 SMTP authentication: YES
      6788:20171029:161447.203 Jabber notifications: YES
      6788:20171029:161447.203 Ez Texting notifications: YES
      6788:20171029:161447.203 ODBC: YES
      6788:20171029:161447.203 SSH2 support: YES
      6788:20171029:161447.203 IPv6 support: YES
      6788:20171029:161447.203 TLS support: YES
      6788:20171029:161447.203 ******************************
      6788:20171029:161447.203 using configuration file: /etc/zabbix/zabbix_server.conf
      6788:20171029:161447.206 [Z3005] query failed: [1146] Table 'zabbixdb.users' doesn't exist [select userid from users limit 1]
      6788:20171029:161447.207 cannot use database "zabbixdb": database is not a Zabbix database
      13714:20171029:165512.360 Starting Zabbix Server. Zabbix 3.0.7 (revision 64609).
      13714:20171029:165512.376 ****** Enabled features ******
      13714:20171029:165512.376 SNMP monitoring: YES
      13714:20171029:165512.376 IPMI monitoring: YES
      13714:20171029:165512.376 Web monitoring: YES
      13714:20171029:165512.376 VMware monitoring: YES
      13714:20171029:165512.376 SMTP authentication: YES
      13714:20171029:165512.376 Jabber notifications: YES
      13714:20171029:165512.376 Ez Texting notifications: YES
      13714:20171029:165512.376 ODBC: YES
      13714:20171029:165512.376 SSH2 support: YES
      13714:20171029:165512.376 IPv6 support: YES
      13714:20171029:165512.376 TLS support: YES
      13714:20171029:165512.376 ******************************
      13714:20171029:165512.376 using configuration file: /etc/zabbix/zabbix_server.conf
      13714:20171029:165512.416 [Z3005] query failed: [1146] Table 'zabbixdb.users' doesn't exist [select userid from users limit 1]
      13714:20171029:165512.416 cannot use database "zabbixdb": database is not a Zabbix database

      Comment

      • kaspars.mednis
        Senior Member
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Oct 2017
        • 349

        #4
        have you created initial zabbix database schema ?

        first you must create db, it seems some zabbixdb already exists on your system.
        it's really recommended to have it initially character set utf8 collate utf8_bin; , otherwise you may run into problems later.



        After that you must import initial schema and data for the server with MySQL:
        Code:
        # zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql zabbixdb -uzabbixuser-pzabbixpassword
        Regards
        Kaspars

        Comment

        • azav8or
          Junior Member
          • Oct 2017
          • 9

          #5
          So I pretty much started over and here is what's going on.

          root@ccvzabbix:/# apt-get install zabbix-server-mysql zabbix-frontend-php
          Reading package lists... Done
          Building dependency tree
          Reading state information... Done
          zabbix-frontend-php is already the newest version (1:3.4.3-2+stretch).
          zabbix-server-mysql is already the newest version (1:3.4.3-2+stretch).
          0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
          root@ccvzabbix:/# zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql -u zabbix -p zabbix
          Enter password:
          ERROR 1698 (28000): Access denied for user 'zabbix'@'localhost'
          root@ccvzabbix:/#

          oot@ccvzabbix:/# mysql -u root -p
          Enter password:
          Welcome to the MariaDB monitor. Commands end with ; or \g.
          Your MariaDB connection id is 18
          Server version: 10.1.26-MariaDB-0+deb9u1 Debian 9.1

          Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

          Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

          MariaDB [(none)]>


          Why is it taking me into MariaDB when I am typing in mysql -u root -p

          Cheers,
          Chris

          Comment

          • kaspars.mednis
            Senior Member
            Zabbix Certified Trainer
            Zabbix Certified SpecialistZabbix Certified Professional
            • Oct 2017
            • 349

            #6
            MariaDb is the same as MySQL on Centos. It's a MySQL fork

            ERROR 1698 (28000): Access denied for user 'zabbix'@'localhost'
            now create the zabbix user as in documentation, grant all needed privileges, and import DB schema after that

            Regards,
            Kaspars

            Comment

            • azav8or
              Junior Member
              • Oct 2017
              • 9

              #7
              Oh ok I didnt know that.
              So now do I do this part that's under the scripts area of the documentation?

              shell> mysql -uroot -p<password>
              mysql> create database zabbix character set utf8 collate utf8_bin;
              mysql> grant all privileges on zabbix.* to zabbix@localhost identified by '<password>';
              mysql> quit;
              # stop here if you are creating database with Zabbix packages
              shell> cd database/mysql
              shell> mysql -uzabbix -p<password> zabbix < schema.sql
              # stop here if you are creating database for Zabbix proxy
              shell> mysql -uzabbix -p<password> zabbix < images.sql
              shell> mysql -uzabbix -p<password> zabbix < data.sql

              I dont think I am using pakages and I know I am not using a proxy so that would mean finish all of the commands right?

              [COLOR="black"][COLOR="black"][COLOR="black"][B][B]MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
              ERROR 2006 (HY000): MySQL server has gone away
              No connection. Trying to reconnect...
              Connection id: 19
              Current database: *** NONE ***

              Query OK, 1 row affected (0.00 sec)

              MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by "barr0Z!";
              Query OK, 0 rows affected (0.00 sec)

              MariaDB [(none)]>

              Comment

              • kaspars.mednis
                Senior Member
                Zabbix Certified Trainer
                Zabbix Certified SpecialistZabbix Certified Professional
                • Oct 2017
                • 349

                #8
                Yes, exactly... First you create a DB for zabbix, then create a zabbix user and grant privileges on that DB (you will use this user/password in zabbix_server.conf and in web frontend config)
                after that create zabbix schema with zcat command, configure web interface - and you are done

                Good luck with this,
                Kaspars

                Comment

                • azav8or
                  Junior Member
                  • Oct 2017
                  • 9

                  #9
                  Thanks so much Kaspars I am so close now. I was able to complete the install and am now at the login. The problem is I cant log in with the username admin or zabbix and the password I have been using the whole time.
                  Shouldn't this be the password that I set up and edited in here?
                  # vi /etc/zabbix/zabbix_server.conf
                  DBHost=localhost
                  DBName=zabbix
                  DBUser=zabbix
                  DBPassword=<password>

                  Comment

                  • Paul M
                    Junior Member
                    • Nov 2017
                    • 8

                    #10
                    No, that's the password zabbix uses to connect to the database, not the user and password you login with.

                    As per the documentation for a new install ;

                    Zabbix frontend is available at http://zabbix-frontend-hostname/zabbix in the browser. Default username/password is Admin/zabbix.
                    The capital 'A' is important btw.

                    Comment

                    • kaspars.mednis
                      Senior Member
                      Zabbix Certified Trainer
                      Zabbix Certified SpecialistZabbix Certified Professional
                      • Oct 2017
                      • 349

                      #11
                      Hello,



                      This is the Zabbix “Welcome” screen. Enter the user name Admin with password zabbix to log in as a Zabbix superuser.
                      The login/password in config file is for zabbix server internal purposes (to connect to mysql DB)

                      For web frontend access, you create logins/passwords which are then stored in this ZabbixDB users table

                      Regards,
                      Kaspars

                      Comment

                      • afzalk5566
                        Junior Member
                        • Mar 2018
                        • 1

                        #12
                        root@briskNOC:~# tail /var/log/zabbix/zabbix_server.log
                        2434:20180316:235324.515 SSH2 support: YES
                        2434:20180316:235324.515 IPv6 support: YES
                        2434:20180316:235324.515 TLS support: YES
                        2434:20180316:235324.515 ******************************
                        2434:20180316:235324.515 using configuration file: /etc/zabbix/zabbix_server.conf
                        2434:20180316:235324.520 current database version (mandatory/optional): 03040000/03040006
                        2434:20180316:235324.521 required mandatory version: 03040000
                        2434:20180316:235324.943 __mem_malloc: skipped 0 asked 56 skip_min 4294967295 skip_max 0
                        2434:20180316:235324.943 [file:strpool.c,line:51] zbx_mem_malloc(): out of memory (requested 50 bytes)
                        2434:20180316:235324.943 [file:strpool.c,line:51] zbx_mem_malloc(): please increase CacheSize configuration parameter
                        root@briskNOC:~# systemctl status zabbix-server
                        ● zabbix-server.service - Zabbix Server
                        Loaded: loaded (/lib/systemd/system/zabbix-server.service; enabled; vendor preset: enabled)
                        Active: activating (auto-restart) (Result: exit-code) since Fri 2018-03-16 23:53:35 +06; 4s ago
                        Process: 2446 ExecStop=/bin/kill -SIGTERM $MAINPID (code=exited, status=0/SUCCESS)
                        Process: 2441 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)
                        Main PID: 2444 (code=exited, status=1/FAILURE)

                        Mar 16 23:53:35 briskNOC systemd[1]: zabbix-server.service: Unit entered failed state.
                        Mar 16 23:53:35 briskNOC systemd[1]: zabbix-server.service: Failed with result 'exit-code'.

                        Comment

                        • huangyingja
                          Junior Member
                          • Apr 2015
                          • 27

                          #13
                          please increase CacheSize configuration parameter <-
                          just edit " /etc/zabbix/zabbix_server.conf "
                          and change " CacheSize "

                          Comment

                          • ganeshyadav
                            Junior Member
                            • Dec 2018
                            • 1

                            #14
                            problem solved....

                            sol:-

                            open file /etc/zabbix/zabbix_server.conf

                            in that search "CacheSize' ---line no 415 -zabbix 4.0

                            un comment it

                            --default is 8M
                            change to 32 M

                            CacheSize=32M

                            thank you njoy...

                            Comment

                            • Siddhesh
                              Junior Member
                              • May 2020
                              • 2

                              #15
                              i have started zabbix-server on zabbix 5.0 but getting some error. "Unit zabbix-server.service entered failed state."

                              ● zabbix-server.service - Zabbix Server
                              Loaded: loaded (/usr/lib/systemd/system/zabbix-server.service; disabled; vendor preset: disabled)
                              Active: active (running) since Fri 2020-05-29 21:07:02 IST; 2min 17s ago
                              Process: 80171 ExecStop=/bin/kill -SIGTERM $MAINPID (code=exited, status=1/FAILURE)
                              Process: 80188 ExecStart=/usr/sbin/zabbix_server -c $CONFFILE (code=exited, status=0/SUCCESS)
                              Main PID: 79515 (code=exited, status=0/SUCCESS)
                              CGroup: /system.slice/zabbix-server.service
                              ├─80191 /usr/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf
                              ├─80202 /usr/sbin/zabbix_server: configuration syncer [synced configuration in 0.035479 sec, idle 60 sec]
                              ├─80205 /usr/sbin/zabbix_server: housekeeper [startup idle for 30 minutes]
                              ├─80206 /usr/sbin/zabbix_server: timer #1 [updated 0 hosts, suppressed 0 events in 0.000906 sec, idle 59 sec]
                              ├─80207 /usr/sbin/zabbix_server: http poller #1 [got 0 values in 0.000978 sec, idle 5 sec]
                              ├─80208 /usr/sbin/zabbix_server: discoverer #1 [processed 0 rules in 0.000847 sec, idle 60 sec]
                              ├─80209 /usr/sbin/zabbix_server: history syncer #1 [processed 1 values, 1 triggers in 0.036749 sec, idle 1 sec]
                              ├─80210 /usr/sbin/zabbix_server: history syncer #2 [processed 0 values, 0 triggers in 0.000059 sec, idle 1 sec]
                              ├─80211 /usr/sbin/zabbix_server: history syncer #3 [processed 0 values, 0 triggers in 0.000053 sec, idle 1 sec]
                              ├─80212 /usr/sbin/zabbix_server: history syncer #4 [processed 0 values, 0 triggers in 0.000063 sec, idle 1 sec]
                              ├─80213 /usr/sbin/zabbix_server: escalator #1 [processed 0 escalations in 0.001637 sec, idle 3 sec]
                              ├─80214 /usr/sbin/zabbix_server: proxy poller #1 [exchanged data with 0 proxies in 0.000055 sec, idle 5 sec]
                              ├─80215 /usr/sbin/zabbix_server: self-monitoring [processed data in 0.000140 sec, idle 1 sec]
                              ├─80216 /usr/sbin/zabbix_server: task manager [processed 0 task(s) in 0.000356 sec, idle 5 sec]
                              ├─80217 /usr/sbin/zabbix_server: poller #1 [got 0 values in 0.000038 sec, idle 1 sec]
                              ├─80218 /usr/sbin/zabbix_server: poller #2 [got 0 values in 0.000036 sec, idle 1 sec]
                              ├─80219 /usr/sbin/zabbix_server: poller #3 [got 0 values in 0.000037 sec, idle 1 sec]
                              ├─80220 /usr/sbin/zabbix_server: poller #4 [got 1 values in 0.001057 sec, idle 1 sec]
                              ├─80221 /usr/sbin/zabbix_server: poller #5 [got 0 values in 0.000034 sec, idle 1 sec]
                              ├─80222 /usr/sbin/zabbix_server: unreachable poller #1 [got 0 values in 0.000044 sec, idle 5 sec]
                              ├─80223 /usr/sbin/zabbix_server: trapper #1 [processed data in 0.001783 sec, waiting for connection]
                              ├─80224 /usr/sbin/zabbix_server: trapper #2 [processed data in 0.000000 sec, waiting for connection]
                              ├─80225 /usr/sbin/zabbix_server: trapper #3 [processed data in 0.000000 sec, waiting for connection]
                              ├─80226 /usr/sbin/zabbix_server: trapper #4 [processed data in 0.000000 sec, waiting for connection]
                              ├─80227 /usr/sbin/zabbix_server: trapper #5 [processed data in 0.000000 sec, waiting for connection]
                              ├─80228 /usr/sbin/zabbix_server: icmp pinger #1 [got 0 values in 0.000042 sec, idle 5 sec]
                              ├─80229 /usr/sbin/zabbix_server: alert manager #1 [sent 0, failed 0 alerts, idle 5.006245 sec during 5.006447 sec]
                              ├─80230 /usr/sbin/zabbix_server: alerter #1 started
                              ├─80231 /usr/sbin/zabbix_server: alerter #2 started
                              ├─80232 /usr/sbin/zabbix_server: alerter #3 started
                              ├─80233 /usr/sbin/zabbix_server: preprocessing manager #1 [queued 0, processed 4 values, idle 5.003158 sec during 5.003394 sec]
                              ├─80234 /usr/sbin/zabbix_server: preprocessing worker #1 started
                              ├─80235 /usr/sbin/zabbix_server: preprocessing worker #2 started
                              ├─80236 /usr/sbin/zabbix_server: preprocessing worker #3 started
                              ├─80237 /usr/sbin/zabbix_server: lld manager #1 [processed 0 LLD rules during 5.004924 sec]
                              ├─80238 /usr/sbin/zabbix_server: lld worker #1 [processed 1 LLD rules, idle 20.945873 sec during 21.328000 sec]
                              ├─80239 /usr/sbin/zabbix_server: lld worker #2 started
                              └─80240 /usr/sbin/zabbix_server: alert syncer [queued 0 alerts(s), flushed 0 result(s) in 0.000899 sec, idle 1 sec]

                              May 29 21:07:02 ABFSTCLCGTWPA systemd[1]: Stopped Zabbix Server.
                              May 29 21:07:02 ABFSTCLCGTWPA systemd[1]: Unit zabbix-server.service entered failed state.
                              May 29 21:07:02 ABFSTCLCGTWPA systemd[1]: zabbix-server.service failed.
                              May 29 21:07:02 ABFSTCLCGTWPA systemd[1]: Starting Zabbix Server...
                              May 29 21:07:02 ABFSTCLCGTWPA systemd[1]: Can't open PID file /run/zabbix/zabbix_server.pid (yet?) after start: No such file or directory
                              May 29 21:07:02 ABFSTCLCGTWPA systemd[1]: Started Zabbix Server

                              Comment

                              Working...