Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zabbix list is not displayed #17

Closed
Diwahars opened this issue May 19, 2015 · 29 comments
Closed

Zabbix list is not displayed #17

Diwahars opened this issue May 19, 2015 · 29 comments

Comments

@Diwahars
Copy link

Hi,

I have configured zabbix data source in grafana, but i couldn't see the hostgroup, host and item in the drop down list.

grafana

@nucleusv
Copy link
Contributor

Have you specified user and password in json config? Press F12 (Developer Tools) to analyze problem.

@Diwahars
Copy link
Author

yea i have specified user name n pwd in json config file.

@alexanderzobnin
Copy link
Collaborator

Please, show screenshot of datasource configuration menu

2015-05-19 19-06-49 grafana - home - mozilla firefox

@alexanderzobnin
Copy link
Collaborator

Are there any errors in the browser's console? (F12 for development tools and then console tab)

@Diwahars
Copy link
Author

Please find the screenshot of datasource config and the console tab (F12 )
grafana1
grafana2

@alexanderzobnin
Copy link
Collaborator

Does your web server require authorization?

@Diwahars
Copy link
Author

no... i use the same URL and username n pwd to get the zabbix data using api...

@alexanderzobnin
Copy link
Collaborator

Look like your web server (zabbix.isus.emc.com) don't allow cross-domain requests from localhost:3000

@alexanderzobnin
Copy link
Collaborator

What web server are you using?

@nucleusv
Copy link
Contributor

Alex, no problem in zabbix api page. Diwahars, what version of zabbix do you have?

@Diwahars
Copy link
Author

Zabbix 2.2
On May 19, 2015 11:00 PM, "nucleusv" notifications@github.com wrote:

Alex, no problem in zabbix api page. Diwahars, what version of zabbix do
you have?


Reply to this email directly or view it on GitHub
#17 (comment)
.

@nucleusv
Copy link
Contributor

Look at api_jsonrpc.php

It must look like
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: Content-Type');
header('Access-Control-Allow-Methods: POST');
header('Access-Control-Max-Age: 1000');

/* THIS STRING ALLOWS OPTIONS TEST QUERY - ADD THIS LINE */
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
return;
}

@alexanderzobnin
Copy link
Collaborator

@nucleusv zabbix api blocks cross-origin resource sharing (cross-domain requests)?

@nucleusv
Copy link
Contributor

Yes, in old version. In 2.4 it seems OK, download zabbix sources, and check this, if in old versions no such line
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
return;
}

I think it should be added to install instructions.

@Diwahars
Copy link
Author

i have a test server with zabbix2.4.. i tried using that to... but still i get error..

grafanna3

@alexanderzobnin
Copy link
Collaborator

Can you test http instead https? May be problem in grafana.

@Diwahars
Copy link
Author

it works with http for zabbix2.4, but still same prob exists for zabbix 2.2...

@nucleusv
Copy link
Contributor

Show screenshot with zabbix 2.2 where grafana performs OPTIONS request OR request with errors, have you changed api_jsonrpc.php page ?

@nucleusv
Copy link
Contributor

Have you added headers output

header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: Content-Type');
header('Access-Control-Allow-Methods: POST');
header('Access-Control-Max-Age: 1000');

?

@Diwahars
Copy link
Author

I have not yet changed api_jsonrpc page..., but changed https to http.. It
worked for zabbix2.4... Likewise I tried for zabbix 2.2... It didn't
work... Will check by changing the api page...

There is no other way to rectify this error... Rather than changing the api
page??
On May 19, 2015 11:51 PM, "nucleusv" notifications@github.com wrote:

Show screenshot with zabbix 2.2 where grafana do OPTIONS request OR
request with errors, have you changed api_jsonrpc.php page ?


Reply to this email directly or view it on GitHub
#17 (comment)
.

@nucleusv
Copy link
Contributor

There is no other way to rectify this error... Rather than changing the api
page??

Yes, it is problem in this page

@nucleusv
Copy link
Contributor

@Diwahars
Copy link
Author

ok...

so i should add these headers is it?
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: Content-Type');
header('Access-Control-Allow-Methods: POST');
header('Access-Control-Max-Age: 1000');

@alexanderzobnin
Copy link
Collaborator

@nucleusv Is this error in zabbix 2.2 only or all version less than 2.4?

@nucleusv
Copy link
Contributor

less than 2.4

@alexanderzobnin
Copy link
Collaborator

Ok, I'll describe this in docs.

@Diwahars
Copy link
Author

@nucleusv should i add these headers is it?
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: Content-Type');
header('Access-Control-Allow-Methods: POST');
header('Access-Control-Max-Age: 1000');

or this one
/* THIS STRING ALLOWS OPTIONS TEST QUERY - ADD THIS LINE */
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
return;
}
?

@nucleusv
Copy link
Contributor

headers and OPTIONS check, replace if there some of these headers

@alexanderzobnin
Copy link
Collaborator

Added fix instructions.

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

No branches or pull requests

3 participants