Ad Widget

Collapse

timeout while executing a shell script (3.4.10)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MarkD
    Junior Member
    • Jun 2018
    • 17

    #1

    timeout while executing a shell script (3.4.10)

    I am seeing an error "timeout while executing a shell script"

    I am using Active Agent on Windows Server.

    I have one script that takes about 10 seconds to return data.

    In zabbix_agentd.win.conf I have:

    Timeout=30

    What am I missing?

    Thanks much!
    Mark
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    Did you specify the file and installed it when installing the Zabbix agent?
    Have you restarted the service after changing the configuration file?

    Have you also changed the setting of Timeout on the Zabbix server side?

    Comment

    • MarkD
      Junior Member
      • Jun 2018
      • 17

      #3
      [~Atsushi], thank you!

      I did restart the agent and I know my User Parameter works because I can run it with different parameters which complete faster and don't trigger the timeout.

      I was not aware of zabbix_server.conf, now I am, thank you!

      I set Timeout=30 in zabbix_server.conf and restarted but I am still getting a timeout. Is there something else I might have missed?

      Thanks much!
      Mark

      Comment

      • Stanislas5
        Junior Member
        • Aug 2018
        • 1

        #4
        Hello,

        we have this issue too in 3.2, however we have not finished our investigation
        We know that we have performance issues.
        Take a look in your Zabbix server logs but I think that the problems comes from this one : He doesn't process sended data in acceptable time (take a look in timeout values but in most of cases it's preferred to improve processing performance)

        Enjoy,

        Comment

        • Starko
          Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • Aug 2012
          • 93

          #5
          I have exactly the same error on Windows Hosts, where I monitor Veeam with a PowerShell Script.
          The scrip is called via:
          Code:
          UserParameter=vbr[*],%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -nologo -command "& '%PROGRAMFILES%\Zabbix\UserParameter\vbr1.0.4.ps1"' "$1" "$2"
          If I test the script via
          Code:
          zabbix_get -s 192.168.24.17 -k vbr[VmCount,287e9538-6d48-4654-8cda-5668fd131e78]
          for example, it works every single time. Takes about 8-14 seconds, but Timeout is set to 30 on Agent and Proxy.
          Did you ever found a solution?

          Comment

          • ozeias.osilva
            Junior Member
            • Sep 2018
            • 3

            #6
            MarkD,

            Take the zabbix agent test:
            Example:

            zabbix_agentd -c C:\zabbix\zabbix_agentd.conf -t vbr[VmCount,287e9538-6d48-4654-8cda-5668fd131e78]

            Often when you perform direct no problem. But when the script is executed by the zabbix process, an extra parameter may be needed for example.

            Comment

            • ozeias.osilva
              Junior Member
              • Sep 2018
              • 3

              #7
              Originally posted by Starko
              I have exactly the same error on Windows Hosts, where I monitor Veeam with a PowerShell Script.
              The scrip is called via:
              Code:
              UserParameter=vbr[*],%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -nologo -command "& '%PROGRAMFILES%\Zabbix\UserParameter\vbr1.0.4.ps1"' "$1" "$2"
              If I test the script via
              Code:
              zabbix_get -s 192.168.24.17 -k vbr[VmCount,287e9538-6d48-4654-8cda-5668fd131e78]
              for example, it works every single time. Takes about 8-14 seconds, but Timeout is set to 30 on Agent and Proxy.
              Did you ever found a solution?
              Starko,

              Test with the following example on userParameter:

              UserParameter=vbr[*],powershell -NoProfile -ExecutionPolicy Bypass -File "%PROGRAMFILES%\Zabbix\UserParameter\vbr1.0.4. ps1" $1 $2

              Comment

              • Starko
                Member
                Zabbix Certified SpecialistZabbix Certified Professional
                • Aug 2012
                • 93

                #8
                @ozeias.osilva
                I tried that, didn't help. Thanks anyway!

                Comment

                • zux
                  Member
                  • Sep 2018
                  • 93

                  #9
                  have you considered running this script from the scheduler of the OS and then using Zabbix sender, to deliver data to Zabbix? I don't like this type of solution, but if you are not able to improve performance of the script, there's not a lot options.

                  Comment

                  • Starko
                    Member
                    Zabbix Certified SpecialistZabbix Certified Professional
                    • Aug 2012
                    • 93

                    #10
                    wmi.get[<namespace>,<query>]
                    Originally posted by rohitparker
                    I just got the same issue here.
                    Running userparameter:
                    UserParameter=product_state,powershell.exe -NoProfile -ExecutionPolicy Bypass -file "C:\Zabbix\av_check.ps1"

                    av_check.ps1:
                    $wmiQuery = "SELECT * FROM AntiVirusProduct"
                    $AntivirusProduct = Get-WmiObject -Namespace "root\SecurityCenter2" -Query $wmiQuery @psboundparameters # -ErrorVariable myError -ErrorAction 'SilentlyContinue'
                    Write-output $AntivirusProduct.productStateinro.in/showbox/ https://inro.in/mobdro/ https://inro.in/tutuapp/
                    Why do you use an external PowerShell Script, for a feature that's native to Zabbix?
                    wmi.get[<namespace>,<query>]

                    Comment

                    • BlackCrystal
                      Junior Member
                      • Dec 2018
                      • 28

                      #11
                      i have this problem too and timeout=30 didnt work. us there anything else i can do?

                      Comment

                      • glardz95
                        Junior Member
                        • Oct 2019
                        • 14

                        #12
                        i have the same problem, is it possible to increase the timeout ?

                        Comment

                        • ZaBeast
                          Member
                          • Sep 2019
                          • 42

                          #13
                          @glrdz95 - you can increase timeout following this step by step guide:
                          Learn how to avoid script, SNMP, or Zabbix agent timeout errors by increasing the Zabbix timeout value on the server, agent, or proxy!


                          Regards

                          Comment

                          • littlegrunge2003
                            Junior Member
                            • Jan 2021
                            • 2

                            #14
                            Wondering if you've fixed this issue. I have similar problem with Zabbix 4.0, UserParam on Solaris OS, and "private" command -- the type is set to "log".

                            Comment

                            • JureSah
                              Junior Member
                              • Aug 2021
                              • 9

                              #15
                              To save some time for any future Googlers who make their way to this topic..

                              According to: https://www.zabbix.com/forum/zabbix-...186#post147186

                              The timeout that applies to shell scripts is hardcoded in Zabbix and the only way to change it is to alter the source code and recompile.

                              In other words, you better optimise your PowerShell script to provide output and bail if it's taking too long.

                              Comment

                            Working...