Ad Widget

Collapse

Script execution - max time to wait

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Crypty
    Member
    • Jul 2012
    • 80

    #1

    Script execution - max time to wait

    Hi,

    Is there any way to increase the time for Zabbix to wait for the script to be finished? Like the "ping" or any user-defined one after clicking on the host.

    I have one script, but it takes longer time than 60 seconds.

    The script finishes at the background, but I do not have any confirmation in the Zabbix, just saying:

    Code:
    Cannot execute script
    Details
    
        Connection timeout of 60 seconds exceeded when connecting to Zabbix server "localhost".
    Thanks for any advice.
  • dramzy
    Junior Member
    • Jan 2017
    • 2

    #2
    Same issue

    I am having the exact same problem, the script is supposed to run for a long time, but Zabbix displays that error and I don't know how to configure it.

    Comment

    • batchenr
      Senior Member
      • Sep 2016
      • 440

      #3
      Originally posted by Crypty
      Hi,

      Is there any way to increase the time for Zabbix to wait for the script to be finished? Like the "ping" or any user-defined one after clicking on the host.

      I have one script, but it takes longer time than 60 seconds.

      The script finishes at the background, but I do not have any confirmation in the Zabbix, just saying:

      Code:
      Cannot execute script
      Details
      
          Connection timeout of 60 seconds exceeded when connecting to Zabbix server "localhost".
      Thanks for any advice.
      i dont know about how to increase it above 30 sec, but i have found a way around it.

      if for example your script value at the end is 0 or 1
      i simply send this output to another file like Results.txt
      and then i set in user parameter like this:
      UserParameter=some.key,cat Results.txt

      you can make your script run throw crontab

      or try to make time shorter- for example if you have a script checking ping for 90 server split it to 3-4 scripts

      Comment

      • SBO
        Zabbix Certified Specialist
        Zabbix Certified Specialist
        • Sep 2015
        • 226

        #4
        Hi,

        For that kind of script, I would use zabbix_sender. That way, at the end of the execution of the script, you can send the value to the Zabbix Server.

        The principal benefit from this is to avoid changing the timeout setting. If it can be useful for that particular script to have a high timeout setting, it can be a problem for other scripts that may time out for whatever reason, and you won't be able to see it because of that setting,

        (Not sure if I explained myself well, my english is pretty rusty this morning, need some coffee !)

        Comment

        • dramzy
          Junior Member
          • Jan 2017
          • 2

          #5
          The script I am running is interactive, it displays prompts to the user along the way and is meant to be run from a Zabbix map. By looking at the source code, it seems that the web frontend has a hard-coded timeout of 60 seconds on scripts in addition to another timeout in the C code for the Zabbix server itself which is configurable from zabbix_Server.conf via the TrapperTimeout option. I can get around the PHP timeout by editing the script, but the TrapperTimeout has a maximum value of 300 seconds, so I would need to recompile from source to get around that. Maybe, I am not using the scripts feature as intended.

          Comment

          • vso
            Zabbix developer
            • Aug 2016
            • 190

            #6
            Originally posted by Crypty
            Hi,

            Is there any way to increase the time for Zabbix to wait for the script to be finished? Like the "ping" or any user-defined one after clicking on the host.

            I have one script, but it takes longer time than 60 seconds.

            The script finishes at the background, but I do not have any confirmation in the Zabbix, just saying:

            Code:
            Cannot execute script
            Details
            
                Connection timeout of 60 seconds exceeded when connecting to Zabbix server "localhost".
            Thanks for any advice.
            If script finishes in background I would probably make 2 scripts.
            1st script does the job and write result to a file.
            2nd script checks the result file and displays result.
            The other option is that 1st script uses zabbix_sender to send result to a trapper, then you can see it in the latest data or make a trigger + action that will send mail to you when script has finished or only in case of failure.

            Comment

            Working...