Skip to content

Could not connect to given url Grafana v5.1.3 (087143285) Integration Zabbix 3.9.1 #586

Closed
@leoswats

Description

@leoswats

I'm submitting a ...

    • [X ] Bug report
    • Feature requestdd
    • Question / Support request

If you don't send bug report, remove sections below

For bug report please include this information:

Software Versions

Grafana Zabbix Grafana-Zabbix Plugin
Grafana v5.1.3 Zabbix 3.9.1 XXXXX

What did you do?

Hello actually I'm new with zabbix and I'm trying integrate Zabbix with Grafana, and when I start to create a new Data Source ( the plugin zabbix is enabled) doesn't show the direct and Proxy options ( only the options: Browser (default) and Browser )

after create the connection, the message Could not connect to given url appears.

What was the expected result?

Describe here
capturar
capturar1

RETURN:

curl -X POST -d '{"jsonrpc":"2.0","method":"apiinfo.version","params":[],"id":1}' -H "Content-Type:application/json" http://IP/zabbix/api_jsonrpc.php

{"jsonrpc":"2.0","result":"3.4.9","id":1}

curl -X POST -d '{"user":"admin","password":"admin"},"id":1}' -H "Content-Type:application/json" http://IP/zabbix/api_jsonrpc.php
{"jsonrpc":"2.0","error":{"code":-32700,"message":"Parse error","data":"Invalid JSON. An error occurred on the server while parsing the JSON text."},"id":null}

What happened instead?

If it relates to metric data visualization would be great to get

  • An image or text representation of your metric query
  • The raw query and response for the network request (check this in chrome dev tools network tab, here you can see metric requests and other request, please include the request body and request response)

Activity

alexanderzobnin

alexanderzobnin commented on Jun 19, 2018

@alexanderzobnin
Collaborator

Hi! The second request looks wrong:

curl -X POST -d '{"user":"admin","password":"admin"},"id":1}' -H "Content-Type:application/json" http://IP/zabbix/api_jsonrpc.php

Data should be like

{"jsonrpc":"2.0","method":"user.login","params":{"user":"admin","password":"admin"},"id":1}

Are you sure that request is made from plugin?

roberdaniel

roberdaniel commented on May 23, 2019

@roberdaniel

I resolved it using Invoke-RestMethod instead of Invoke-WebRequest, and now api "understand" my json. (powershell code)
Curl never worked for me. is equivalent to to Invoke-WebRequest.
(I'm in Zabbix 4.2)

MacroJG

MacroJG commented on Jul 11, 2019

@MacroJG

I met the same problem, I add a Zabbix datasource on remote host, then click the "Save & Test" button , show "Could not connect to given url", but I already added a local host zabbix datasource successfuly.
My grafana and zabbix info:
grafana: 10.0.35.19:3000 v6.2.5
zabbix plugin: 3.10.2
zabbix datasource1: 10.0.35.19:8000 v4.2 (OK)
zabbix datasource2: 10.0.35.143:8010 v3.2 (NOK)
图片
图片

MacroJG

MacroJG commented on Jul 11, 2019

@MacroJG

Add zabbix datasource like this:
图片
图片

MacroJG

MacroJG commented on Jul 11, 2019

@MacroJG

Problem resolved !
Just change the HTTP URL from
"http://10.0.35.143:8010/zabbix/api_jsonrpc.php"
to "http://10.0.35.143:8010/api_jsonrpc.php"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @alexanderzobnin@MacroJG@roberdaniel@leoswats

        Issue actions

          Could not connect to given url Grafana v5.1.3 (087143285) Integration Zabbix 3.9.1 · Issue #586 · grafana/grafana-zabbix