Ad Widget

Collapse

Zabbix Agent won't start automatically after host reboot

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • KaP
    Junior Member
    • Mar 2016
    • 5

    #1

    Zabbix Agent won't start automatically after host reboot

    Hi,

    We installed zabbix v3.0.0 on most of our 2008R2 servers, everything works like a charm until the hosts are restarted (weekly).

    After hosts reboots, a lot of zabbix agents won't start automatically, and nothing mentionned in the zabbig_agent.log.

    If we start the agents manually, they start perfectly, with no error.

    After rebooting, some agents will start normally on a host, and the week after not.

    The "SC /Query" command does not show any service status error, it just says that the service is stopped.

    The Windows Event Viewer says that "The service did not respond to the start or control request in a timely fashion".

    Do you have an idea of what could cause this ?

    Thanks,

    KaP
    Last edited by KaP; 10-03-2016, 12:38.
  • KaP
    Junior Member
    • Mar 2016
    • 5

    #2
    FYI, here are the active lines of our conf file :

    Code:
    LogFile=c:\import\zabbix\zabbix_agentd.log
    DebugLevel=3
    Server=10.2.3.70
    ServerActive=10.2.3.70
    HostnameItem=system.run[cmd /Q /S /C "for /f "usebackq skip=1" %d in (`wmic computersystem get Domain`) do (for /f %h in ('hostname') do echo %h.%d)"]

    Comment

    • GPegel
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2015
      • 113

      #3
      I have a couple of Windows Servers running the Zabbix Agents automatically after a reboot. Maybe it has something to do with your configuration file. There are two different things that I don't have enabled in my config. It's the line about logging and debugging. Logfile and DebugLevel are commented in my configuration file so they are not active. Maybe you could try to comment those two lines?

      Another idea, who is the owner of the Zabbix Agent Service? In other words, which account is used to start the Service? In my case it's the "local system account". You can find it in "services.msc", right click on Zabbix Agent and click "properties" and on the 2nd tab called "Log on" I've selected the "Local System account"

      Comment

      • KaP
        Junior Member
        • Mar 2016
        • 5

        #4
        Hi,

        Thanks for your answer.

        The account used to start the service is "Local system account" too.

        I have not tried tried to comment LogFile and DebugLevel for the moment because I am trying something else :

        I replaced the wmi request for the HostnameItem by a little .vbs which might be faster to execute when the servers are booting.

        I'll let you know if it does the trick !

        Regards

        Comment

        • Atsushi
          Senior Member
          • Aug 2013
          • 2028

          #5
          In the case of Windows, it might Zabbix agent before the network initialization from being started.
          Zabbix agent can not be started and fail to bind the network.

          Please Try to Change Startup Type to 'Automatic (Delayed start)'.

          Comment

          • KaP
            Junior Member
            • Mar 2016
            • 5

            #6
            Hi Atsushi,

            You are right, I forgot to mention it in my first post : I already tried to change the startup type in Delayed start, and it worked perfectly.

            But I tought that this couldn't be the solution, just a workaround.
            And as we have a lot of servers, that meant we would have to script this change for all the servers after each new zabbix agent version.

            The strange thing is that it used to work a few months ago with a quite old version (like 2.2 maybe) with a normal start.

            One question : are we the only ones who get this kind of problem ?

            Thanks for your help

            Comment

            • G3r0m3G
              Junior Member
              • Dec 2012
              • 16

              #7
              Hi all,

              I have the same problem as described with zabbix agent 3.0.1 from suiviperf.com site. I contacted the builder of the package to have some help.

              In addition, the delayed start parameter for the service is not sufficient for me because the problem persist.

              I keep you informed,

              Jerome

              Comment

              • LenR
                Senior Member
                • Sep 2009
                • 1005

                #8
                Build your install process to set Hostname instead of using a dynamic HostnameItem. Do the logic once, at install, instead of at each startup.

                Comment

                • G3r0m3G
                  Junior Member
                  • Dec 2012
                  • 16

                  #9
                  Hello KaP

                  After investigation with Michel Manceron from suiviperf.com, the parameter to modify is Timeout in zabbix agent configuration file, increase this value because on some hosts, the script launched to fill hostnameitem parameter can be long and the startup of zabbix fail. You can use automatic startup mode as standard and not delayed in this case.

                  I think 15sec Timeout value is sufficient to avoid problems. In my case it's working perfectly. For information Timeout default value is 3sec.

                  The problem can occurs on system who are overloaded at startup or when you have a lot of services to launch at startup.

                  Jerome
                  Last edited by G3r0m3G; 12-04-2016, 09:13.

                  Comment

                  • G3r0m3G
                    Junior Member
                    • Dec 2012
                    • 16

                    #10
                    Hello All,

                    I have again the issue too, I have replaced the zabbix agent provided by suiviperf.com with the Zabbix agent on zabbix.com but the result is the same.

                    Is it possible to open a new case ?

                    Thank you,

                    Jerome

                    Comment

                    • G3r0m3G
                      Junior Member
                      • Dec 2012
                      • 16

                      #11
                      Hello all,

                      You can follow the ticket about the issue here :


                      Do not hesitate to participate

                      Comment

                      • Jsonn
                        Junior Member
                        • Oct 2016
                        • 1

                        #12
                        After running into this same issue I came up with a work around. I am using a scripted installer and during this process I am doing a DNS suffix lookup from ipconfig and using that to modify the config file and set the Hostname= variable . Then I run the installer with the Unique config file, for our environment the local lookup works fine but a DNS lookup should still work. Here is the Powershell script I run before installation.Hope this helps.

                        Code:
                        $a = ipconfig /all | Select-String "Primary Dns Suffix" 
                        $c,$d=$a -Split ": "
                        $hostname = $env:COMPUTERNAME + "."+ $d
                        $FQDN = "Hostname=" + ($hostname.ToLower())
                        #gets .conf file from copied location during installation.  
                        (Get-Content -Path C:\Doit\Zabbix\conf\zabbix_agentd.win.conf).Replace('# Hostname=',$FQDN) | Set-Content C:\Doit\Zabbix\conf\zabbix_agentd.win.conf

                        Comment

                        Working...