neuralfraud / grafana-prtg

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

Cannot enumerate anything when creating dashboard #151

Open Ginolard opened 4 years ago

Ginolard commented 4 years ago

Glad to see this is being developed again! I'd stopped using it due to various bugs.

Anyway, just installed the latest version and it's installed OK (I get the API version number when creating the Data source).

However, when I try to create a dashboard it's doesn't seem to enumerate any devices or sensors. In the Group field all I get is '' or 'Root'. In the Host and Sensor fields all I can select is ''

Any ideas what might be wrong?

angela-d commented 4 years ago

I had that occur when I was first experimenting with this plugin, too.

I'm not certain, but I think it was attributable to the date format of the user I created for the API access. It has to be MM/DD/YYYY HH:MM:SS (AM/PM) or it doesn't seem to work right.

I just recently started working with this plugin and I wrote everything down, hopefully neuralfraud opens the wiki so some of the common problems can be addressed for others to easily access.

My notes are here, hopefully they can lend some assistance!

Ginolard commented 4 years ago

Yeah, I have a user (prtgapi) that is configured with that date format as I read your comment on the wiki. Still doesn't seem to work tough.

angela-d commented 4 years ago

Are you familiar with the browser console?

In Firefox, right-click > Inspect Element > Click to the Console tab > click the trash can to clear any previous requests

Then, delete all of the fields and try again. See where your API is getting junked up. I ran into an issue yesterday where one of my target sensors in a group was returning a blank/unexpected value, which caused the entire graph to return "No Data" .. not particularly the same issue you're running into, but perhaps your target is returning something it shouldn't at some point.

If you aren't getting any errors logged, your API user - is it an administrator, with read/write permission? Originally, I set mine as a read-only user and I was only getting the API status returned, minimal sensor data, which sounds similar to what you describe.

While I was testing, I used my own PRTG login as the API user. Once I was comfortable with how everything was working, I re-created an API-only user.

Update:

I just ran into this, myself.

Also useful:

Disable caching via the browser console:

Ginolard commented 4 years ago

Aha! I just created a new API user (non-admin) and that works. I guess that old one that I used way back with the old plugin had some problem.

angela-d commented 4 years ago

non admin?

Can you share what you did? When I tried to get a non-admin API user to work I couldn't pull any (useful) sensor info. I'd much prefer to use a non-admin and would love to see what I may have done wrong!

forever765 commented 4 years ago

@angela-d I have been using a non-admin account in grafana and the functionality is basically normal.

angela-d commented 4 years ago

I changed my API user to a standard PRTG User and my dashboard threw No Data for everything.

I wasn't the admin that originally set up PRTG, so I suspect there may be some unconventional permissions running on my setup. I will have to dig around and see.

Update:

PRTG User Group had no permissions - and for some reason, I had just assumed this would not be the case, so I never checked.

Since I was in there, I went ahead and created an API group with restricted, read-only access. If anyone comes across this post that had done the same thing I did, I updated my notes on how I set up the API user.