neuralfraud / grafana-prtg

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

Table with json data does not update in TEXT and RAW mode [Fix] #123

Closed Sonnenstrahl closed 5 years ago

Sonnenstrahl commented 5 years ago

85

51

114

115

I noticed that applying the following changes to /dist/PRTGAPIService.js fixes the json data problem: Remove [Line 113 - 115]

          if (this.inCache(options.url)) {
            return this.getCache(options.url);
          } else {

Remove [Line 158]

        }

Your tables should now update in realtime.

olsonnn commented 5 years ago

Since we applied this patch, the load on our prtg has increased a lot. Rolled back but it seems the modified js file is cached now in browsers... Be carefull with this 'patch'

AnimaBe commented 5 years ago

Anyone have another fix for this?

ll4mat commented 5 years ago

Same problem here

Warning / Down Sensor Table don't refresh except you refresh the Website over the Browser (F5). Creating a Playlist is not suitable for us.

We also don't like to apply the mentioned Patch cause olsonnn reported that it would inrease the Prtg-Core-Server load a lot.

forever765 commented 5 years ago

@neuralfraud I also have the same question. The problem seriously affects the use in the production environment, can you give priority to it? Thank you very much!

neuralfraud commented 5 years ago

If you dont want to use cache you can always disable it.

There is a reason its there though.

Sent from my iPhone

On Jan 24, 2019, at 7:30 AM, Sonnenstrahl notifications@github.com wrote:

85

51

114

115

I noticed that applying the following changes to /dist/PRTGAPIService.js fixes the json data problem: Remove [Line 113 - 115]

      if (this.inCache(options.url)) {
        return this.getCache(options.url);
      } else {

Remove [Line 158]

    }

Your tables should now update in realtime.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

neuralfraud commented 5 years ago

I am sorry you did that; plain bad advice. That line just adds data to the cache and then never uses it, its effectively disabling the cache with extra steps.

Sent from my iPhone

On Jan 28, 2019, at 5:39 AM, olsonnn notifications@github.com wrote:

Since we applied this patch, the load on our prtg has increased a lot. Rolled back but it seems the modified js file is cached now in browsers... Be carefull with this 'patch'

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

forever765 commented 5 years ago

@neuralfraud can you fix this bug fundamentally?