Ad Widget

Collapse

Webhook - Connection timeout

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • slpefanis
    Member
    • Jan 2020
    • 52

    #1

    Webhook - Connection timeout

    Hi All

    I'm trying to configure a webhook, but am stuck with the following error "
    • Connection timeout of 3 seconds exceeded when connecting to Zabbix server "localhost"."
    I cannot seem to see what is causing this as everything else seems to be working.

    I can't even see the Zabbix server traffic in my FW so not sure what it's doing.

    S
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    Name resolution for localhost may have failed. Is it described in /etc/hosts? Does it work by specifying localhost as an argument of the ping command on the terminal?
    After that, the web server you connect to may not allow localhost connections. Check that the Web server is ready to accept connections on localhost (IP: 127.0.0.1).

    Comment

    • slpefanis
      Member
      • Jan 2020
      • 52

      #3
      Thanks. This is coming up when i test my webhook via the Media Types screen. I'm not sure where it's tring to hit localhost. (have replaced the values correcty)

      Click image for larger version

Name:	Capture.PNG
Views:	1409
Size:	22.9 KB
ID:	394824

      The Javascript is:
      Code:
      try {
      params = JSON.parse(value),
      req = new CurlHttpRequest(),
      fields = {};
      req.AddHeader('Content-Type: application/json');
      req.AddHeader('Authorization: Basic params.token');
      
      fields.description= params.description;
      fields.subject = params.subject ;
      fields.email =  params.email ;
      fields.priority =  params.priority ;
      fields.status = params.status ;
      
      var resp = req.Post('https://helpdeskURL/helpdesk/tickets.json',
      JSON.stringify(fields)
      );
      if (req.Status() != 200) {
      throw JSON.parse(resp).errors[0];
      }
      resp = JSON.parse(resp);
      return "OK";
      } catch (error) {
      Zabbix.Log(3, 'FreshService notification failed : '+error);
      throw 'FreshService notification failed : '+error;
      }
      Last edited by slpefanis; 05-02-2020, 02:41.

      Comment

      Working...