neuralfraud / grafana-prtg

A PRTG Datasource plugin for Grafana
181 stars 75 forks source link

Problem With API Connection in PRTG 16.1.21.1421/1422 #8

Closed ptcfast2 closed 8 years ago

ptcfast2 commented 8 years ago

I've been trying to get Grafana to connect to my newly updated PRTG installation but I've yet to have luck. For whatever reason I get the following error when testing connectivity within Grafana even with the URL field correctly filled out:

Unknown error Cannot read property 'url' of undefined

Grafana version is 2.5.0. I tried with 2.6.0 as well with no luck.

neuralfraud commented 8 years ago

Show some screenshots or copy&paste browser javascript console output, please.

make sure api url includes /api

On Fri, Jan 29, 2016 at 7:29 PM, ptcfast2 notifications@github.com wrote:

I've been trying to get Grafana to connect to my newly updated PRTG installation but I've yet to have luck For whatever reason I get the following error when testing connectivity within Grafana:

Unknown error Cannot read property 'url' of undefined

— Reply to this email directly or view it on GitHub https://github.com/neuralfraud/grafana-prtg/issues/8.

ptcfast2 commented 8 years ago

Sure thing! Let me know if I can do anything more to help. image image

neuralfraud commented 8 years ago

bloody strange. I'll take a look today. and also, which version of Grafana?

On Mon, Feb 1, 2016 at 12:46 PM, ptcfast2 notifications@github.com wrote:

Sure thing! Let me know if I can do anything more to help. [image: image] https://cloud.githubusercontent.com/assets/16966701/12725651/96081a24-c8c8-11e5-8e74-7b6ffff75529.png [image: image] https://cloud.githubusercontent.com/assets/16966701/12725677/ac20eeee-c8c8-11e5-9d8e-c22f9f3cd2b7.png

— Reply to this email directly or view it on GitHub https://github.com/neuralfraud/grafana-prtg/issues/8#issuecomment-178092370 .

ptcfast2 commented 8 years ago

I'm presently running 2.5.0 but also tried with 2.6.0 before reverting. Same issue on both.

neuralfraud commented 8 years ago

Ok. The javascript code isn't that great! it's most likely failing due to the Access Control Origin header ...you did set that up right? HKLM\SOFTWARE\Wow6432Node\Paessler\PRTG Network Monitor\Server\Webserver? String value "AccessControlAllowOriginHTTPHeader" (REG_SZ) needs to match the URL you use to access grafana (because you're using the proxy feature). If it's not specified, OR it doesn't match, then the connection will fail (unless you use https - which for whatever reason just works)

neuralfraud commented 8 years ago

you can also set it to *

ptcfast2 commented 8 years ago

Yeah I have that set in the registry. I've tried both ways - with the * and the actual URL. Tried, HTTP, HTTPS, different addresses and still no dice. Tried running Grafana on the server and off the server as well. Off the server with proxy and no proxy. Same result every time.

image

neuralfraud commented 8 years ago

Only other thing i can think of is that you're accessing a site with an untrusted certificate (because you're accessing via IP). The weird unexpected token error though, that's an internal function... which is strange, by any chance does your password contain some very bizarre and/or strange characters?

ptcfast2 commented 8 years ago

It was the password. We use very complex stuff, so I took it down a notch and it's working now. Thanks for the suggestion!

neuralfraud commented 8 years ago

if you dont mind, since its changed, what did you use outside of the normal A-Za-z0-9 character set?

ptcfast2 commented 8 years ago

" % ' ?