Mikesch-mp / icingaweb2-module-grafana

Grafana module for Icinga Web 2 (supports InfluxDB & Graphite)
https://icinga.com/community/
GNU General Public License v2.0
241 stars 95 forks source link

Undefined $dashboarduid when using Iframe mode #266

Closed mdetrano closed 3 years ago

mdetrano commented 3 years ago

When using the iFrame mode to view graphs from Grafana, opening any host or service produces error:

Undefined property: Icinga\Module\Grafana\ProvidedHook\Grapher::$dashboarduid

Expected Behavior

Should show the grafana frame.

Current Behavior

Shows:

0 /usr/share/icingaweb2/modules/grafana/library/Grafana/ProvidedHook/Grapher.php(259): Icinga\Application\ApplicationBootstrap->Icinga\Application{closure}(Integer, String, String, Integer, Array)

1 /usr/share/icingaweb2/modules/grafana/library/Grafana/ProvidedHook/Grapher.php(379): Icinga\Module\Grafana\ProvidedHook\Grapher->getMyPreviewHtml(String, String, String)

2 /usr/share/icingaweb2/modules/monitoring/application/views/scripts/show/components/grapher.phtml(3): Icinga\Module\Grafana\ProvidedHook\Grapher->getPreviewHtml(Object(Icinga\Module\Monitoring\Object\Host))...

Possible Solution

In Grapher.php, line 259, it looks like the variable in question is not defined when iFrame mode is used. May have missed a call to getGraphConf or some other means to initialize it.

Steps to Reproduce (for bugs)

1. 2. 3. 4. Select iFrame for "Grafana Access" in module configuration, then view details on any host or service.

Context

Your Environment

Bierchermuesli commented 3 years ago

Same here, same versions.