Ad Widget

Collapse

Zabbix_server scripts problems

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • NicoZanferrari
    Junior Member
    • Jun 2011
    • 23

    #1

    Zabbix_server scripts problems

    Hi,
    I've just updated to 1.8.8 on CentOS 6. I've found that the init.d scripts does not work anymore automatically on reboot. Looking at the logs, it complains not to be able to connect to mysql ("Cannot connect to the database. Exiting..."). It seems to be run before mysqld is working. Running a "service zabbix_server start" works fine.
    Does anyone have the same problem?

    Also, "service zabbix_server restart" have never worked correctly because it does not wait the full stop of the processes before trying to restart them - and the result is a stopped service.

    Last but not least, a standard "service zabbix_server status" option would be nice ;-)

    Nico
  • p3dro114
    Junior Member
    • Aug 2011
    • 3

    #2
    maybe /etc/inet.d/zabbix-server not found

    Comment

    • NicoZanferrari
      Junior Member
      • Jun 2011
      • 23

      #3
      no, the script /etc/inet.d/zabbix-server works fine. And I see from zabbix_server logs that it tries to start after reboot...

      Thanks,
      nico

      Comment

      • HullZabbix
        Senior Member
        • Feb 2011
        • 104

        #4
        Here's something from my internal wiki. This is for centos 5.4 and zabbix 1.8.6, but should be fine for your setup.

        Zabbix autostart¶
        Browse to /etc/rc3.d This folder contains links to scripts which launch programs at run level 3.
        Items begining with K1 - K99 are killed at run level 3.
        Items begining with S1 - S99 are started at run level 3.
        Items are launched in numerical order. K through 1-99 then S through 1-99.

        Look for the shortcut which contains mysql - it should be in the form S64mysql, 64 being a seemingly random number.
        Make sure the links for zabbix_agentd and zabbix_server are any number AFTER mysql.
        e.g
        S64mysqld
        S65zabbix_agentd
        S66zabbix_server

        Comment

        • NicoZanferrari
          Junior Member
          • Jun 2011
          • 23

          #5
          Thank you, AxidaZabbix.

          I've looked at it, and I have the following important links inside /etc/rc3.d :

          S55zabbix_agentd
          S56zabbix_server
          S64mysqld

          and so this is the problem!

          Of course I can rename them in order to resolve my issue, but I'm wondering what was wrong...
          I've installed Zabbix following http://www.zabbix.com/wiki/howto/ins..._source_manual (with a manual "make install" and not the checkinstall).

          Cheers,
          Nico

          Comment

          • HullZabbix
            Senior Member
            • Feb 2011
            • 104

            #6
            What's wrong is that zabbix is attempting to start before mysql has started.

            Zabbix cannot run without it, thus you get the error: "Cannot connect to the database. Exiting..." because the database cannot be found while the mysql service is stopped.

            The wiki "creating startup scripts" section should probably have something like the above in, I feel it would be fairly useful if an admin feels like sticking it in there.
            Last edited by HullZabbix; 04-10-2011, 15:08.

            Comment

            • NicoZanferrari
              Junior Member
              • Jun 2011
              • 23

              #7
              Got it! Looking at the source script file zabbix_server (under misc/init.d/redhat/8.0), I can see the chkconfig line

              # chkconfig: - 55 45

              and thus the 55 priority on startup.

              The EPEL rpm (http://download.fedora.redhat.com/pu...2.el6.i686.rpm) instead has a

              # chkconfig: - 85 15

              which is much better! I'm adding a note on the wiki tomorrow.

              Comment

              • bcrowder
                Junior Member
                • Sep 2011
                • 10

                #8
                If the file /etc/init.d/zabbix_server has a line like:
                # chkconfig: - 55 45

                1) chkconfig --del zabbix_server
                2) edit /etc/init.d/zabbix_server, change it to # chkconfig: - 90 10
                3) chkconfig --add zabbix_server
                4) chkconfig zabbix_server on

                Comment

                Working...