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

Error obtaining dashboard #10

Closed
veerareddyganta opened this issue Dec 1, 2016 · 4 comments
Closed

Error obtaining dashboard #10

veerareddyganta opened this issue Dec 1, 2016 · 4 comments

Comments

@veerareddyganta
Copy link

veerareddyganta commented Dec 1, 2016

Thanks IzakMarais for providing a tool to export grafana dashboard into a pdf file.

I have tried it and getting the following error when I clicked on the link in dashboard. I have installed grafana on a linux box(myLinuxPC) and launching the dashboard link from my windows box using http://xx.xx.xx.xxx:3000/dashboard/db/backendlistner. Url for exporting to pdf is - http://xx.xx.xx.xxx:8686/api/report/backendlistner

Error obtaining dashboard: {"message":"Unauthorized"}

Logs on my linux box:
$./grafana-reporter
2016/12/01 11:37:52 grafana reporter, version: 0.6-2 hash: de8d06baeab734a93ce36032d283c852de5d394e
2016/12/01 11:37:52 serving at ':8686' and using grafana at 'localhost:3000'
2016/12/01 12:00:18 Reporter called
2016/12/01 12:00:18 Called with api Token:
2016/12/01 12:00:18 Called with dashboard: backendlistner
2016/12/01 12:00:18 Called with time range: {1479884394820 1479884800264}
2016/12/01 12:00:18 Connecting to dashboard at http://localhost:3000/api/dashboards/db/backendlistner
2016/12/01 12:00:18 Error obtaining dashboard: 401 Unauthorized
2016/12/01 12:00:18 Error generating report: Error obtaining dashboard: {"message":"Unauthorized"}

@IzakMarais
Copy link
Owner

Based on the error it looks like you have Auth enabled on your Grafana. You will need to use the api Token parameter of the grafana-reporter, or disable auth in your Grafana settings.

@veerareddyganta
Copy link
Author

@IzakMarais Thanks for your reply.
Could you please give me an steps and an example to use api token parameter of the grafana-reporter?

@IzakMarais
Copy link
Owner

You would have to retrieve the API token from Grafana, e.g. using the GUI. Somewhere there is an API keys section under admin settings.

Once you have the token, you need to pass it as a query parameter

 /api/report/backendlistner?apitoken=XXXXXX

@veerareddyganta
Copy link
Author

I forgot to close this issue.

I tried by disabling auth by making the following changes in 'Anonymous Auth' section of grafana.ini file and it worked for me.
enabled = true
org_role = Admin

Thanks for your help.

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

No branches or pull requests

2 participants