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

Wrong Grafana IP specified #103

Closed
mafrancis opened this issue Dec 10, 2018 · 7 comments
Closed

Wrong Grafana IP specified #103

mafrancis opened this issue Dec 10, 2018 · 7 comments

Comments

@mafrancis
Copy link

mafrancis commented Dec 10, 2018

Hi Sir,
I am planning to take a PDF report for my dashboard. I followed all your steps. but I am getting below error when I click the PDF icon.

[root@inmonprd1 bin]# ./grafana-reporter
2018/12/10 13:37:06 grafana reporter, version: 2.1-0 hash: 997082a
2018/12/10 13:37:06 serving at ':8686' and using grafana at 'localhost:3000'
2018/12/10 13:39:54 Reporter called
2018/12/10 13:39:54 Called with api Token:
2018/12/10 13:39:54 Called without variable
2018/12/10 13:39:54 Called with dashboard: hofnQd-mk
2018/12/10 13:39:54 Called with time range: {now-5m now}
2018/12/10 13:39:54 Connecting to dashboard at http://localhost:3000/api/dashboards/uid/hofnQd-mk
2018/12/10 13:39:54 Error generating report: error fetching dashboard hofnQd-mk: error executing getDashboard request for http://localhost:3000/api/dashboards/uid/hofnQd-mk: Get http://localhost:3000/api/dashboards/uid/hofnQd-mk: dial tcp 127.0.0.1:3000: connect: connection refused

In Browser:-
error fetching dashboard hofnQd-mk: error executing getDashboard request for http://localhost:3000/api/dashboards/uid/hofnQd-mk: Get http://localhost:3000/api/dashboards/uid/hofnQd-mk: dial tcp 127.0.0.1:3000: connect: connection refused

My Dashboard Report URL - http://monitoring.otpp.com:8686/api/v5/report/hofnQd-mk?from=now-5m&to=now

Please help me to fix this issue.

@IzakMarais
Copy link
Owner

It seems like your Grafana serving at a different URL? From the log above:

2018/12/10 13:37:06 serving at ':8686' and using grafana at 'localhost:3000'
...
dial tcp 127.0.0.1:3000: connect: connection refused

From the readme:

Running without any flags assumes Grafana is reachable at localhost:3000:
grafana-reporter
Query available flags:
grafana-reporter --help

Perhaps you should use the ip command line option to specify the correct IP port combination for Grafana.

@mafrancis
Copy link
Author

Hi Team,
This issue has been fixed now. But i have the other issue like... I got my PDF of my dashboard but its not comes in proper alignment
EDP HEALTH CHECK MONITORING DASHBOARD REPORT.pdf

dashboard

Please help me how to align PDF same as dashboard.
.

@IzakMarais IzakMarais changed the title Grafana PDF Report Issue Wrong Grafana IP specified Dec 14, 2018
@mafrancis
Copy link
Author

Hi Izak, I have issue with pdf alignment please can you help me with that.

@IzakMarais
Copy link
Owner

Is this a scripted dashboard or does it have dynamic number of rows based on the data? The reporter doesn't currently support those types of dashboards. It is also not clear whether it would be possible to do given the Grafana API. See #79.

I tested again on a test dashboard with a graph panel and two single stat boxes. The dashboad:
dashboard
The report:
image

You can customise the layout of the report to an extent by providing your own LaTeX template. See the template section of the readme as well as #50.

@Baboy71
Copy link

Baboy71 commented Jan 7, 2019

I love it when people fix issues themselves but never explain what they did!!!

I have the same issue. Grafana and reporter on the same server and used Docker to install and run. First I found Grafana didnt like the url as shown in the video as it needs http://at the beginning but now I try I get the following message:

2019/01/07 12:36:00 Reporter called
2019/01/07 12:36:00 Called with api Token:
2019/01/07 12:36:00 Called with variable: var-Project [All]
2019/01/07 12:36:00 Called with dashboard: Y93vOd-mk
2019/01/07 12:36:00 Called with time range: {now-7d now}
2019/01/07 12:36:00 Connecting to dashboard at http://localhost:3000/api/dashboards/uid/Y93vOd-mk?var-Project=All
2019/01/07 12:36:00 Error generating report: error fetching dashboard Y93vOd-mk: error obtaining dashboard from http://localhost:3000/api/dashboards/uid/Y93vOd-mk?var-Project=All. Got Status 401 Unauthorized, message: {"message":"Unauthorized"}

I tried running it with the ip flag to point it to the grafana ip address but just cant figure out the correct syntax as it doesnt like -ip xx.xx.xx.xx:3000 or any varient I could think of.

any clues as to how to fix it?

@Baboy71
Copy link

Baboy71 commented Jan 8, 2019

I figured it out!! I needed to add an api token to the URL I was calling

@concept-trainer
Copy link

I figured it out!! I needed to add an api token to the URL I was calling

i have followed and stuck at this point can you advise how you generate and add api token to solve unauthorized access issue.

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

4 participants