Ad Widget

Collapse

Changing external command timeout

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • antoniogmyo
    Junior Member
    • Aug 2009
    • 9

    #1

    Changing external command timeout

    Hi,

    Sorry if this is documented somewhere, but I couldn´t find it. Is there a way to modify the external commands time out?.

    Thanks in advance.
  • fjrial
    Senior Member
    • Feb 2010
    • 140

    #2
    Hi:

    Yes, in zabbix_server.conf you can find a section like this

    Code:
    ### Option: Timeout
    #       Specifies how long we wait for agent, SNMP device or external check (in seconds).
    #
    # Mandatory: no
    # Range: 1-30
    # Default:
    # Timeout=3
    Cheers.

    Comment

    • antoniogmyo
      Junior Member
      • Aug 2009
      • 9

      #3
      I forgot to mention I´m running zabbix 1.6.7. In my zabbix_server.conf file I just got this section:


      # Specifies how long we wait for agent response (in sec)
      # Must be between 1 and 30
      Timeout=30


      does this apply to external commands too?

      Thanks in advance.

      Comment

      • fjrial
        Senior Member
        • Feb 2010
        • 140

        #4
        Sorry, but for that version I don't know if "TimeOut" applies to external checks too..

        I know that this works fine for Zabbix 1.8.2 and 1.8.3

        Cheers.
        Last edited by fjrial; 31-08-2010, 09:44. Reason: including more information

        Comment

        • alixen
          Senior Member
          • Apr 2006
          • 474

          #5
          Hi,

          Originally posted by antoniogmyo
          I forgot to mention I´m running zabbix 1.6.7. In my zabbix_server.conf file I just got this section:


          # Specifies how long we wait for agent response (in sec)
          # Must be between 1 and 30
          Timeout=30


          does this apply to external commands too?
          Yes, it does.
          We use a lot of external checks, some of them may sometime need more than 20 seconds to complete.
          We have used Timeout=30 parameter on our Zabbix server since 1.6.2 (now upgraded to 1.8.3) without problem.

          Regards,
          Alixen
          http://www.alixen.fr/zabbix.html

          Comment

          • antoniogmyo
            Junior Member
            • Aug 2009
            • 9

            #6
            Thanks both for the responses.

            Getting deeper into this....to rise a bit the max timeout...let´s say to 60 seconds, should I modify source code and recompile?. Any clue where to look for?. I know it is a bit too much, and it would be nice if I could separate external commands timeout from agent timeout, but by now we need to set it up to 60 seconds at least.

            Cheers.

            Comment

            • fjrial
              Senior Member
              • Feb 2010
              • 140

              #7
              I think that you have to edit source code.. looking into source code at 1.8.2 I am able to find these occurrences:

              src/zabbix_proxy/proxy.c: {"Timeout",&CONFIG_TIMEOUT,0,TYPE_INT,PARM_OPT,1,3 0},
              src/zabbix_server/server.c: {"Timeout",&CONFIG_TIMEOUT,0,TYPE_INT,PARM_OPT,1,3 0},
              src/zabbix_agent/zbxconf.c: {"Timeout", &CONFIG_TIMEOUT, 0,TYPE_INT, PARM_OPT, 1,30},
              src/zabbix_agent/zabbix_agent.c: {"Timeout",&CONFIG_TIMEOUT,0,TYPE_INT,PARM_OPT,1,3 0},

              I think you should change those "30" (max allowed value) for whatever you want... recompile source code and try...

              I don't know if you can have server timeout distinct from agent timeout .. you should try.. if zabbix_agent or zabbix_server refuses to start, you'll need to add more source code in order to allow them to have different values.
              Last edited by fjrial; 31-08-2010, 10:48. Reason: more info

              Comment

              • antoniogmyo
                Junior Member
                • Aug 2009
                • 9

                #8
                Hi,

                It seems that it worked fine. Modifying the server.c and compiling again with no problems.

                Not sure how to check in the logs how long takes the script to run, I´ll modify script to log itself start and ending time.

                Thanks guys for the help.

                Best regards.

                Comment

                • ZaBeast
                  Member
                  • Sep 2019
                  • 42

                  #9
                  As a rule of thumb, try not to increase timeout value more than 10 sec. unless you have no option.Why? Becase you can lock your pollers if you have tons of script that timeout regullary.

                  But, if you are going to use high timeout value then try to overprovision the number of pollers in Zabbix configuration file and check regularly Zabbix health statistic.

                  You can increase timeout over 30 sec by changing “Timeout” in source file src/zabbix_server/server.c and recompiling Zabbix server.

                  Check this Step-By-Step Guide: https://bestmonitoringtools.com/incr...rver-or-agent/
                  Last edited by ZaBeast; 09-10-2019, 22:40.

                  Comment

                  Working...