icingaweb2-module-grafana icon indicating copy to clipboard operation
icingaweb2-module-grafana copied to clipboard

icingaweb - grafana, Dependencies Unmet dependencies found

Open gbin2265 opened this issue 2 years ago • 5 comments

Describe the bug

is it possible that icingadb with grafana , without module monitoring, is not yet fully supported ? When I disable the monitoring module to work fully under icingadb I get the error in the module grafana:

Dependencies Unmet dependencies found! Module can't be enabled unless all dependencies are met. Modules monitoring * (2.11.1, disabled)

but I do see the graphs.

This is the message cli

icingacli module enable grafana

Enabling module "grafana" although it has unmet dependencies

When is the monitoring module back activated the message is gone.

Expected behavior

that there are no errors/warnings in the module grafana when i activate it.

To Reproduce

activate grafana module when monitoring module is disabled

Your Environment

  • Icinga Web 2 version and modules (System - About):

Icinga Web 2 Version 2.11.1 Git commit eecf8d9934cbf30ec063cea4a525b26bfd2bf99a PHP Version 7.3.29 Git commit date 2022-07-06 Get Icinga Support Icinga Community Report a bug Icinga Documentation Loaded Libraries icinga/icinga-php-library 0.9.1 icinga/icinga-php-thirdparty 0.11.0 Loaded Modules icingadb 1.0.0 Configure monitoring 2.11.1 Configure

  • Web browser used: Chrome

  • Icinga 2 version used (icinga2 --version):

icinga2 - The Icinga 2 network monitoring daemon (version: r2.13.4-1)

Copyright (c) 2012-2022 Icinga GmbH (https://icinga.com/) License GPLv2+: GNU GPL version 2 or later https://gnu.org/licenses/gpl2.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

System information: Platform: Red Hat Enterprise Linux Server Platform version: 7.9 (Maipo) Kernel: Linux Kernel version: 3.10.0-1160.59.1.el7.x86_64 Architecture: x86_64

Build information: Compiler: GNU 11.2.1 Build host: runner-hh8q3bz2-project-322-concurrent-0 OpenSSL version: OpenSSL 1.0.2k-fips 26 Jan 2017

  • PHP version used (php --version): PHP 7.3.29 (cli) (built: Jul 1 2021 09:50:42) ( NTS )

  • Server operating system and version: Red Hat Enterprise Linux Server release 7.9 (Maipo)

gbin2265 avatar Jul 11 '22 17:07 gbin2265

should work with #288

RincewindsHat avatar Jul 20 '22 20:07 RincewindsHat

Hi,

I have done recently a new icinga installation with both backends enabled: Monitoring and ICINGA DB. I am using the Grafana module 1.4.3. When I disable the Monitoring module, Grafana is still working. But, when I would like to change the time in grafana, e.g. to display only the graph for the last 5 minutes, I receive the error message:

Page not found. Enabling the "monitoring" module might help!

When I enable the monitoring module, it works again. But I would like to keep the monitoring module disabled.

Thanks in advance.

jeff8688 avatar Aug 19 '22 10:08 jeff8688

@jeff8688 hi, I was just solving same issue > try to check library/Grafana/ProvidedHook/Grapher.php and edit this part:

    public function getPreviewHtml(MonitoredObject $object, $report = false)
    {
        $this->object = $object;
        // enable_perfdata = true ?  || disablevar == true
        if (!$this->object->process_perfdata || (( isset($this->object->customvars[$this->custvardisable]) && json_decode(strtolower($this->object->customvars[$this->custvardisable])) !== false)) ) {
            return '';
        }

        if ($this->object instanceof Host) {
            $this->cacheTime = $this->object->host_next_check - $this->object->host_last_check;
            $serviceName = $this->object->check_command;
            $hostName = $this->object->host_name;
            $parameters = array(
                'name' => $this->object->host_name,
            );
            $link = 'icingadb/host';
        } elseif ($this->object instanceof Service) {
            $this->cacheTime = $this->object->service_next_check - $this->object->service_last_check;
            $serviceName = $this->object->service_description;
            $hostName = $this->object->host->getName();
            $parameters = array(
                'host.name' => $this->object->host->getName(),
                'name' => $this->object->service_description,
            );
            $link = 'icingadb/service';
        }

focus to "$parameters" and "$link" variables ... ;)

btrnka63 avatar Aug 19 '22 13:08 btrnka63

@BorisTrnka Excellent, I have applied your changes and it works now. Just one more question please: I am using grafana access "iframe" and it works, but I cannot get indirect proxy mode working. I receive curl timeout. Is indirect proxy mode working for you? Just want to figure out if my indirect proxy config is wrong or if my problem is due to incompatibility. Thanks.

jeff8688 avatar Aug 19 '22 14:08 jeff8688

@jeff8688 I haven't spent much time to make the "indirect proxy" to work as "iframe" works fine ...

btrnka63 avatar Aug 19 '22 14:08 btrnka63

This version of the module is not made for icingadb, wait for 2.0.0

Mikesch-mp avatar Feb 23 '23 11:02 Mikesch-mp