Ad Widget

Collapse

Zabbix 3.0 Service not running after reboot

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TheDude
    Junior Member
    • Feb 2016
    • 13

    #1

    Zabbix 3.0 Service not running after reboot

    Hello All,

    after setting up Zabbix 3.0 on a Ubuntu 14.04.5 LTS server I am wondering why zabbix server process is not been started after system start. I am able to start it manually by "service zabbix-server start" but I would like to have it auto started.

    Have someone of you a hint for me how to solve this issue?

    Many thanks in advance,
    best regards

    TheDude
  • brico
    Junior Member
    Zabbix Certified Specialist
    • Feb 2012
    • 10

    #2
    Based on what you're reporting, I assume:
    • You're using the provided upstart config file (misc/init.d/ubuntu/zabbix-server.conf)
    • It is located in /etc/init/zabbix-server.conf
    • The zabbix_server binary location is correct in the conf file


    Otherwise, do you see any message in the zabbix_server.log on startup that may indicate an issue?

    I'm running an instance of 3.0.4 on Ubuntu 14.04.5 LTS running zabbix_server and zabbix_agent as user 'root'. I confirm processes start on boot.

    Comment

    • TheDude
      Junior Member
      • Feb 2016
      • 13

      #3
      ... when doing a "find / -name "zabbix-server*" -print" the following is found:

      Code:
      /etc/init.d/zabbix-server
      /etc/logrotate.d/zabbix-server-mysql
      /usr/lib/tmpfiles.d/zabbix-server.conf
      /usr/share/doc/zabbix-server-mysql
      /lib/systemd/system/zabbix-server.service
      /var/cache/apt/archives/zabbix-server-mysql_1%3a3.0.4-1+trusty_amd64.deb
      /var/lib/dpkg/info/zabbix-server-mysql.list
      /var/lib/dpkg/info/zabbix-server-mysql.postrm
      /var/lib/dpkg/info/zabbix-server-mysql.postinst
      /var/lib/dpkg/info/zabbix-server-mysql.conffiles
      /var/lib/dpkg/info/zabbix-server-mysql.md5sums
      That's all. Nothing matches the defaults you have given to me.

      I have installed ZABBIX using the following:

      Code:
      wget http://repo.zabbix.com/zabbix/3.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.0-1+trusty_all.deb
      dpkg -i zabbix-release_3.0-1+trusty_all.deb
      apt-get update
      apt-get install zabbix-server-mysql zabbix-frontend-php
      apt-get install zabbix-agent
      Also I have updated the zabbix-server.conf to match my environment.

      Having a look into the log file these are the last entries:

      Code:
      Cannot adopt OID in UCD-SNMP-MIB: laIndex ::= { laEntry 1 }
        9339:20160908:111318.195 server #23 started [history syncer #4]
        9319:20160908:111329.687 cannot send list of active checks to "127.0.0.1": host [Zabbix server] not monitored
        9321:20160908:111529.702 cannot send list of active checks to "127.0.0.1": host [Zabbix server] not monitored
        9314:20160908:111619.185 enabling Zabbix agent checks on host "Zabbix server": host became available
        9334:20160908:111625.209 [Z3005] query failed: [2006] MySQL server has gone away [insert into history (itemid,clock,ns,value) values (23305,1473326185,188332121,0.158373);
      ]
        9334:20160908:111625.209 [Z3001] connection to database 'zabbix' failed: [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
        9334:20160908:111625.209 Cannot connect to the database. Exiting...
        9306:20160908:111625.211 One child process died (PID:9334,exitcode/signal:1). Exiting ...
        9306:20160908:111627.211 [Z3001] connection to database 'zabbix' failed: [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
        9306:20160908:111627.212 Cannot connect to the database. Exiting...
        1039:20160908:111647.008 Starting Zabbix Server. Zabbix 3.0.4 (revision 61185).
        1039:20160908:111647.009 ****** Enabled features ******
        1039:20160908:111647.009 SNMP monitoring:           YES
        1039:20160908:111647.009 IPMI monitoring:           YES
        1039:20160908:111647.009 Web monitoring:            YES
        1039:20160908:111647.009 VMware monitoring:         YES
        1039:20160908:111647.009 SMTP authentication:       YES
        1039:20160908:111647.009 Jabber notifications:      YES
        1039:20160908:111647.009 Ez Texting notifications:  YES
        1039:20160908:111647.009 ODBC:                      YES
        1039:20160908:111647.009 SSH2 support:              YES
        1039:20160908:111647.009 IPv6 support:              YES
        1039:20160908:111647.009 TLS support:               YES
        1039:20160908:111647.009 ******************************
        1039:20160908:111647.009 using configuration file: /etc/zabbix/zabbix_server.conf
        1039:20160908:111647.047 [Z3001] connection to database 'zabbix' failed: [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
        1039:20160908:111647.057 Cannot connect to the database. Exiting...
      Having a look into /var/run/mysqld I found the following:

      Code:
      ls -al
      total 4
      drwxr-xr-x  2 mysql root   80 Sep  8 11:16 .
      drwxr-xr-x 22 root  root  720 Sep  8 11:17 ..
      -rw-rw----  1 mysql mysql   4 Sep  8 11:16 mysqld.pid
      srwxrwxrwx  1 mysql mysql   0 Sep  8 11:16 mysqld.sock
      Have you maybe got an idea what the root cause is? Thank you.

      Best regards
      TheDude

      Comment

      • brico
        Junior Member
        Zabbix Certified Specialist
        • Feb 2012
        • 10

        #4
        Ah ok, apologies for the confusion. I typically install everything from source, so the setup is a bit different.

        After performing a new installation with the packages on 14.04.5, it looks as though the MySQL server is starting after the zabbix-server which is why it cannot connect over the socket connection (as indicated by the zabbix_server.log).

        One way to fix this would be to change the priority of the zabbix-server service from S20 to S99 by running the following:

        Code:
        update-rc.d -f zabbix-server remove
        update-rc.d -f zabbix-server start 99 2 3 4 5 . stop 20 0 1 6 .
        The above will create the appropriate symbolic links in the run level directories

        Code:
        # update-rc.d -f zabbix-server remove
         Removing any system startup links for /etc/init.d/zabbix-server ...
           /etc/rc0.d/K20zabbix-server
           /etc/rc1.d/K20zabbix-server
           /etc/rc2.d/S20zabbix-server
           /etc/rc3.d/S20zabbix-server
           /etc/rc4.d/S20zabbix-server
           /etc/rc5.d/S20zabbix-server
           /etc/rc6.d/K20zabbix-server
        
        # update-rc.d -f zabbix-server start 99 2 3 4 5 . stop 20 0 1 6 .
         Adding system startup for /etc/init.d/zabbix-server ...
           /etc/rc0.d/K20zabbix-server -> ../init.d/zabbix-server
           /etc/rc1.d/K20zabbix-server -> ../init.d/zabbix-server
           /etc/rc6.d/K20zabbix-server -> ../init.d/zabbix-server
           /etc/rc2.d/S99zabbix-server -> ../init.d/zabbix-server
           /etc/rc3.d/S99zabbix-server -> ../init.d/zabbix-server
           /etc/rc4.d/S99zabbix-server -> ../init.d/zabbix-server
           /etc/rc5.d/S99zabbix-server -> ../init.d/zabbix-server

        Comment

        • TheDude
          Junior Member
          • Feb 2016
          • 13

          #5
          Hello Brico,

          ... no problem.

          I believe that you were right. I have performed the two steps and after a reboot the server cames up automatically.

          Many thanks for your help! This I was really not able to solve by myself.

          Best regards
          TheDude

          Comment

          Working...