neuralfraud / grafana-prtg

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

I cannot read the data "cannot read property 1 or null" #173

Open lodbrokk opened 4 years ago

lodbrokk commented 4 years ago

Hello friends, I currently have grafana v7.0.3 and PRTG 20.2.59.1689 installed, I have already connected the plugin with the PRTG API but when creating a dashboard to read the data it does not allow I show them the configuration to see if they can help me graf3 graf2 graf1

ray-haggerty commented 3 years ago

experiencing the same issue

ecorea commented 3 years ago

I also encountered this problem. As it turned out, the reason for everything is the latest fix. The regular expression only processes dates with the "/" separator. I fixed my regular expression. Now it should handle delimited dates "/" "." "-". Line 514 should now look like this: datetime:Date.parse(results[iter]["datetime"]. match (/(\d+\/|-|\.\d+\/|-|\.\d+\s\d+:\d+:\d+\s\w+)\s?/)[1]), Link to the commit that caused this problem: https://github.com/neuralfraud/grafana-prtg/commit/d39d6b35d5244ffc91887ed6e2ae66d54a56b14a

In it you will be able to see the file name and the string you want to replace.

WillIrvine commented 3 years ago

The other option is to change your API user to use the date format with "/" as a delimiter This can be done in the users settings... saves changing the code :D

Im using MM/DD/YYYY HH:MM:SS (A.M./P.M.)

ecorea commented 3 years ago

I can only select date formats with a separator "." I will assume that in this case it is necessary to change the date format on the server, which is not applicable in my case.