IzakMarais / reporter

Service that generates a PDF report from a Grafana dashboard
Apache License 2.0
958 stars 308 forks source link

Got Status 401 Unauthorized, message: {"message":"Unauthorized"} #197

Open MohammadSalehAtypon opened 4 years ago

MohammadSalehAtypon commented 4 years ago

I'm using docker container to run grafana-reporter, I'm running it using : grafana-reporter -cmd_apiKey XxMyApiTockenxX ... etc but I got Unauthorized message. I noticed it's take it as empty !! see : === 2020/02/18 16:13:19 Reporter called 2020/02/18 16:13:19 Called with api Token: 2020/02/18 16:13:19 Called without variable 2020/02/18 16:13:19 Called with dashboard: Nwgnc-3mk 2020/02/18 16:13:19 Called with time range: {now-1h now} === api Token is empty ! but if I used -cmd_enable=1 on my command it take it with no issues ! Any idea?

vijayakumarbathini commented 4 years ago

You can try by passing API token in URL field under links of dashboard

Sample URL format : http://{Reporter Server}:8686/api/v5/report/{dashboardUID}?apitoken={tokenid}

Regards Vijaya Kumar

IzakMarais commented 4 years ago

Yes, you cannot mix cmd line mode flags with non cmd line mode flags. If you want to run the reporter in the standard way (as a service hosting an http api) you need to pass the grafana api key via the reporter url parameter as described in the readme.

xuwenjj commented 3 years ago

Comment out "org_name=" in the grafana configuration file