Open Danrockan opened 10 months ago
Hello,
can you also do this for php 8.3?
regards, Geert
I have solved it in 1.4.2 but I guess it's the same solution in the latest version as well. It's a pretty simple one. Here are the patches I'm using on my master servers.
I guess the first one is already solved in later versions of the grafana module. But for 1.4.2 it is needed.
--- /usr/share/icingaweb2/modules/grafana/library/Grafana/Helpers/Timeranges.php.orig 2024-02-01 17:09:46.976830967 +0000
+++ /usr/share/icingaweb2/modules/grafana/library/Grafana/Helpers/Timeranges.php 2024-02-01 17:10:54.218580572 +0000
@@ -92,7 +92,7 @@
private function buildTimerangeMenu($timerange = "", $timerangeto = "")
{
$clockIcon = $this->view->qlink('', 'dashboard/new-dashlet',
- ['url' => 'grafana/dashboard?' . http_build_query($this->urlparams, null, '&', PHP_QUERY_RFC3986)],
+ ['url' => 'grafana/dashboard?' . http_build_query($this->urlparams, '', '&', PHP_QUERY_RFC3986)],
['icon' => 'clock', 'title' => 'Add graph to dashboard']);
$menu = '<table class="grafana-table"><tr>';
--- /usr/share/icingaweb2/modules/grafana/library/Grafana/ProvidedHook/Grapher.php.orig 2024-02-01 17:06:22.991519674 +0000
+++ /usr/share/icingaweb2/modules/grafana/library/Grafana/ProvidedHook/Grapher.php 2024-02-01 17:08:03.964150996 +0000
@@ -55,6 +55,13 @@
protected $cacheTime = 300;
protected $grafanaVersion = "0";
protected $defaultdashboarduid;
+ protected $permission;
+ protected $object;
+ protected $dashboard;
+ protected $dashboarduid;
+ protected $panelId;
+ protected $orgId;
+ protected $customVars;
protected function init()
{
Hello,
based on what @mvahani gave as information, I only added these lines in the file IcingaDbGrapher.php
diff --git a/library/Grafana/ProvidedHook/Icingadb/IcingaDbGrapher.php b/library/Grafana/ProvidedHook/Icingadb/IcingaDbGrapher.php
--- a/library/Grafana/ProvidedHook/Icingadb/IcingaDbGrapher.php
+++ b/library/Grafana/ProvidedHook/Icingadb/IcingaDbGrapher.php
@@ -68,6 +68,12 @@ trait IcingaDbGrapher
protected $grafanaVersion = "0";
protected $defaultdashboarduid;
protected $object;
+ protected $permission;
+ protected $dashboard;
+ protected $dashboarduid;
+ protected $panelId;
+ protected $orgId;
+ protected $customVars;
Now I have no more errors in icingadb-web in combination with php 8.3
I also add these 2 cases for the iframe provided by @dnsmichi as a pull request: https://github.com/Mikesch-mp/icingaweb2-module-grafana/pull/318 https://github.com/Mikesch-mp/icingaweb2-module-grafana/pull/328
As a result, I now have the link "see in grafana" above the graph
See here all the modification I made iframe_and_php83.txt
Thank you. This worked for me
same issue with PHP 8.1(.28) Deprecated : substr_count(): Passing null to parameter #1 ($haystack) of type string is deprecated in /usr/share/icingaweb2/modules/grafana/library/Grafana/ProvidedHook/Icingadb/IcingaDbGrapher.php on line 403
Hello, i have the same Problem with PHP8.2 In my case, I also had to add protected $pngUrl;.
so that the error messages were gone. However, I still have the problem that only the mini icon is displayed and no graph. I have already re-downloaded the module and tested it again, but without success. I am using PHP8.2. Do you have any ideas? I have been testing for several days. The Grafana/Influxdb connection works. When I copy the generated Debug link for iFrame into the browser, I get the graphic. But not within the Icinga plugin or with Indirect Proxy.
Thank you, Heiko
hello, when im enable graphana modole i have bellow errors in: /icingaweb2/dashboard#!/icingaweb2/icingadb/host?name=
lsb_release -a
head -n 2 /etc/icingaweb2/enabledModules/*/module.info
icingacli module list
dpkg-query -l icinga php | grep ^ii