grafana-prtg icon indicating copy to clipboard operation
grafana-prtg copied to clipboard

Incorrectly formatted table data with "Blah" added as field name

Open craftzneko opened this issue 4 years ago • 14 comments

when creating a table panel using an example listed here before

Query mode - Raw table.json and content=sensors&columns=objid,downtimesince,device,sensor,lastvalue,status,message,priority&filter_status=5&filter_status

returns 3 fields each called "Blah" and inside each of these is the data i need. Grafana wont format it correctly into a table im assuming because of the above. I looked at the query inspector and the "blah" doesnt appear in the data returned, could this be introduced by the plugin unintentionally or by grafana? 1

craftzneko avatar Sep 10 '20 14:09 craftzneko

Want to follow this, is one of the stoppers on my dashboard project! Can't see to find an solution for this :(

Attached a screendump on how far I came! Grafana-Blah

joachimd90 avatar Sep 17 '20 07:09 joachimd90

Looking at the raw data that gets passed to grafana, this is something the plugin is doing. This data is shown in the Panel Data section of query inspector. Notice the "Blah" added in "name" and "refid" im guessing "blah" is a placeholder for something that should be passed?

{ "state": "Done", "series": [ { "name": "blah", "refId": "blah", "meta": { "json": true, "transformations": [ "calculateField", "calculateField" ] }, "fields": [ { "name": "blah", "type": "other", "config": {}, "values": [ { "objid": 2410, "objid_raw": 2410, "downtimesince": "10 h 6 m", "downtimesince_raw": 36399, "device": "Lansweeper", "device_raw": "Lansweeper", "sensor": "Service Lansweeper Server", "sensor_raw": "Service Lansweeper Server", "lastvalue": "", "lastvalue_raw": "", "status": "Down", "status_raw": 5, "message": "<div class="status">This service is either not installed on the target system or it is stopped. To monitor a service and make sure that it is NOT running, see https://kb.paessler.com/en/topic/64529. (code: PE207)<div class="moreicon">", "message_raw": "This service is either not installed on the target system or it is stopped. To monitor a service and make sure that it is NOT running, see https://kb.paessler.com/en/topic/64529. (code: PE207)", "priority": "3", "priority_raw": 3 } ], "state": { "displayName": "blah", "scopedVars": { "__series": { "text": "Series", "value": { "name": "blah" } }, "__field": { "text": "Field", "value": {} } } } } ], "length": 1 },

craftzneko avatar Sep 17 '20 09:09 craftzneko

I have now tried to use Grafana V7.2.0-beta1 with PRTG plugin 4.0.4, and this time I get another error in Grana..

bilde

joachimd90 avatar Sep 28 '20 10:09 joachimd90

If you have any fields with null data, it will break the whole panel.

Adjust your "Last x hours" at the top. I find between 3 and 6 hours selection is a sweet spot for the data not getting mangled.

7.2 appears to have options to handle empty data, but I've not tested it to see if the panel still breaks.

angela-d avatar Oct 04 '20 04:10 angela-d

After 1 week of different testing, I went over to test different grafana versions to see who could serve me the best solution as today.. I got all my dashs to work with Grafana v6.3.0 and with plugin 4.0.4.. So far so good.. The auto refresh are working, it's shows metrics and table data.. I am missing some panel options, but that's just "nice2have"...

joachimd90 avatar Oct 04 '20 20:10 joachimd90

Any news of this? :O

AImXOo0o avatar Oct 16 '20 12:10 AImXOo0o

Realize this is not going to be a suitable solution for everyone and would love the plugin to work, but its clear its not an active development and hasnt been for along time. In the future with newer version's of grafana your only going to end up with more breaking bugs. A solution I have moved to is to use SQL as the middle man between PRTG and Grafana. It works really well and gives us much more control. You can configure PRTG to run a custom script on changes or just when a sensor is down. Just use a powershell script to write details to a SQL table and then query that in grafana.

craftzneko avatar Oct 16 '20 12:10 craftzneko

@pr1malc0de Hey. How is your setup now? Do you have a short guide or something like this?

Thanks in advance.

AImXOo0o avatar Oct 19 '20 17:10 AImXOo0o

Hi. Has this problem solved? table headers still show as blah for any table.json query. I use version 7.15 of grafana and version 4.04 of the prtg plugin

atilanomontero avatar Dec 30 '20 14:12 atilanomontero

Same issue here, i did find out if you use outer join under transform does display the rows but for the columns i just see 1 named blah. image

EYEVO avatar Mar 05 '21 14:03 EYEVO

The solve the issue I think Grafana need to bring back the solution on how you want to display the data.

In earlier releases you are able to choose JSON data and some other options, I can’t see this options anywhere after v6.0.0

//JD

On 5 Mar 2021, at 15:17, Ivo [email protected] wrote:



Same issue here, i did find out if you use outer join under transform does display the rows but for the columns i just see 1 named blah. [image]https://user-images.githubusercontent.com/16328089/110127263-b85c0600-7dc5-11eb-9371-edb94ece7073.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/neuralfraud/grafana-prtg/issues/176#issuecomment-791446275, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AM52OET34XN3MSZYUON4GKDTCDRVZANCNFSM4RFGIAGA.

joachimd90 avatar Mar 05 '21 15:03 joachimd90

A solution that works!

After a lot of Googling, I came across someone who had the problem with their table view, and there they had solved the problem by changing Panel JSON.

They replaced

"type": "table"

with

"type": "table-old"

Tested this and then got back the option by choosing which data to display, and everything was no longer sorted by "BLAH" as before.

This supports my theory that Grafana has made some changes in how they retrieve JSON data and has nothing to do with the PRTG Plugin for grafana (I think) .. But I encountered a new problem, and that is that the text now comes from right instead of coming from the left .. But here I think it's a simple solution, somewhere ..

Feel free to look at the screenshot I have added, some censorship was needed!

By the way, I am currently running version 7.5.0-Beta1 with Grafana PRTG plugin 4.0.3

(Note to myself: Looks like Transform aren't working after changing table-type) Type-Table-Old

joachimd90 avatar Mar 08 '21 14:03 joachimd90

"type": "table-old" does not work anymore on grafana 8.... Any other options to display the json as a proper table?

yurividal avatar Jun 17 '21 16:06 yurividal

If you set "Outer Join" & "Extract Fields" & "Filter by Name". This is the latest version of grafana

image

Melladay88 avatar Apr 14 '22 16:04 Melladay88