Ad Widget

Collapse

Zabbix 4.0 Action Script Always Timeout

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • terektek
    Junior Member
    • Mar 2019
    • 1

    #1

    Zabbix 4.0 Action Script Always Timeout

    Hi Everyone,

    I'm new to zabbix and really want to try this amazing tools.

    I have a problem trying to get custom script in action working. I made simple custom shell script to be invoked in action. It's just few line of codes with just curl command being called.
    I tried the script from the terminal and executed succesfully in less than 5s - 10s. But when I see the Reports->Action Log, the status was Failed and the Info was Timeout while executing a shell script.

    I've tried increasing the Timeout parameter both in zabbix_server.conf and zabbix_agentd.conf to 30s, but it seems not working. I've also tried changing the permission of the script that is located in /usr/lib/zabbix/alertscripts to 777 and chown to zabbix user.

    I see the log from zabbix_server.log and it looks like just:

    126:20190313:103327.204 In zbx_popen() command:'/usr/lib/zabbix/alertscripts/sendMessage.sh'
    126:20190313:103327.206 End of zbx_popen():8
    126:20190313:103327.206 zbx_popen(): executing script

    I installed zabbix 4 in ubuntu 16.04 using zabbix appliance.

    Any ideas or suggestions for the problem? Really need help.
    Thank you.
  • brunohl
    Senior Member
    Zabbix Certified Specialist
    • Mar 2019
    • 215

    #2
    Why don't you create a Media Type with your script?
    (Check https://www.zabbix.com/documentation...s/media/script)

    Try this, then on your action configuration you use "Send Message" instead of "Remote Command". I guess that the timeouts are bigger there.

    Them Timeouts that you increased would not reflect on any change on the script timeout, I guess.

    Comment

    • ITIC007
      Junior Member
      • Oct 2018
      • 19

      #3
      I also have this problem, even when using the Media Script as _brunohl_ suggested. Increasing the "Timeout" parameter didn't have any effect. The media that is timing out is a ServiceNow API call to create incidents.

      Timeout happens on 40% on cases, in average. Any additional suggestions?

      Comment

      • andreft
        Junior Member
        • Dec 2019
        • 6

        #4
        Originally posted by ITIC007
        I also have this problem, even when using the Media Script as _brunohl_ suggested. Increasing the "Timeout" parameter didn't have any effect. The media that is timing out is a ServiceNow API call to create incidents.

        Timeout happens on 40% on cases, in average. Any additional suggestions?
        Are you using that perl-ServiceNow-API using SOAP?
        If yes, how are you getting the parameters in your script to send it further?
        thanks

        Comment


        • ITIC007
          ITIC007 commented
          Editing a comment
          I am using a python script to make the integration. This is a very good existing sample that should get you started https://share.zabbix.com/cat-app/app...ts-from-zabbix

          In terms of the communication from ServiceNow back to Zabbix --- we are using ServiceNow table API.


          Take a look and let me know if you have questions.

        • Kavya
          Kavya commented
          Editing a comment
          In terms of the communication from ServiceNow back to Zabbix --- we are using ServiceNow table API.

          =========================

          Could you help me out how can this be achieved
      • andreft
        Junior Member
        • Dec 2019
        • 6

        #5
        I tried but I got some errors and I thought it was related to the python modules, if you don't mind would you please share which OS, Zabbix and Python versions you are using?
        Also, how did you install the modules? via pip?
        I just read few articles that SOAPpy and PyXML are quite obsolete and I gave up after few days only getting errors - but maybe I configured something in a wrong way, what I did was:
        - created a media type with the script name and parameters {ALERT.SENDTO}, {ALERT.SUBJECT} and {ALERT.MESSAGE}
        - created action with an operation to send message to user via media type created previously (that calls the script)
        Is there anything else that should be configured?
        I'm using Zabbix 4.0 installed on Fedora 31
        Thanks in advance.

        Comment

        • bxabi
          Junior Member
          • Dec 2015
          • 2

          #6
          I have this exact problem too when I test an alert script.
          Code:
          Connection timeout of 3 seconds exceeded when connecting to Zabbix server "localhost".
          I don't understand why would a connection to localhost would be needed at all.

          Comment

          Working...