icingaweb2 with Grafana error messages

This forum was archived to /woltlab and is now in read-only mode.
  • Hi,


    I've been trying to integrate Grafana with icingaweb2 to have nice graphs. I've used influxdb as the backend (easier and cleaner than Graphite). The grafana module I'm using https://github.com/Mikesch-mp/…odule-grafana/tree/v1.1.6 (awesome job by the way). I can see some graphs in Grafana web but only error messages on icingaweb2 when I choose the direct access but no error messages with no graphs when I use iframe access. Influxdb, Grafana server, and Icingaweb2 are all installed on the same server. Here is my configuration:


    /etc/icingaweb2/modules/grafana/config.ini


    /etc/icinga2/features-enabled/influxdb.conf


    When I click on any host, I get:

    The Grafana module's version is 1.1.6. I also set the username and password of the Grafana web in the config.ini of the module but that didn't help.

  • Line 254 in that file leads to imgClass not being initialized. I guess it is this bug: https://github.com/Mikesch-mp/…-module-grafana/issues/68 (redownload 1.1.6 and try again).

  • It works! It was surely that bug. I had version 1.1.6 and I thought it was fixed. All services that have perf data now have graphs:). One more thing, no graphs shown when I click on any host (hostalive no data points). I imported the two dash boards from the module to Grafana web, do I need to change something?

  • Line 254 in that file leads to imgClass not being initialized. I guess it is this bug: https://github.com/Mikesch-mp/…-module-grafana/issues/68 (redownload 1.1.6 and try again).

    Was my fault, i did again too much at once :(


    It works! It was surely that bug. I had version 1.1.6 and I thought it was fixed. All services that have perf data now have graphs:). One more thing, no graphs shown when I click on any host (hostalive no data points). I imported the two dash boards from the module to Grafana web, do I need to change something?

    Did you configure the graph for hostalive like any other service? see my screenshot (still have to put it more cleary into the readme)


  • HI,


    Thanks for your help Mikesch. I'm a little bit confused. I can already see the graphs when I click on the services except that when I click on the hosts. Do I have to add all the checks manually? I see that I can get the panel ID from the URL from Grafana web but what about the variables? Could you please show me an example?

  • Hello,


    icinga2-default comes in place when there is no graph configured like in my screenshot above.

    base-metrics is just an example to use for some services that are mostly used and are configured (see screenshot).

    You canalso create your own dashboard and panels in Grafana and use them inside the modeule.


    Regards,


    Carsten

  • Hello Guys,


    I think I get the same issue with version

    Code
    1. https://github.com/Mikesch-mp/icingaweb2-module-grafana/archive/v1.1.8.zip


    Graphs are available in grafana, but errors shows in icingaweb as below



    Fatal error: Uncaught Error: Call to undefined function Icinga\Module\Grafana\ProvidedHook\curl_init() in /usr/share/icingaweb2/modules/grafana/library/Grafana/ProvidedHook/Grapher.php:221 Stack trace: #0 /usr/share/icingaweb2/modules/grafana/library/Grafana/ProvidedHook/Grapher.php(372): Icinga\Module\Grafana\ProvidedHook\Grapher->getMyPreviewHtml('hostalive', 'ip-172-16-115-1...', '') #1 zend.view:///usr/share/icingaweb2/modules/monitoring/application/views/scripts/show/components/grapher.phtml(2): Icinga\Module\Grafana\ProvidedHook\Grapher->getPreviewHtml(Object(Icinga\Module\Monitoring\Object\Host)) #2 /usr/share/php/Icinga/Web/View.php(231): include('zend.view:///us...') #3 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(877): Icinga\Web\View->_run('/usr/share/icin...') #4 zend.view:///usr/share/icingaweb2/modules/monitoring/application/views/scripts/partials/object/detail-content.phtml(3): Zend_View_Abstract->render(NULL) #5 /usr/share/php/Icinga/Web/View.php(231): include('zend.view:///us...') #6 /usr/s in /usr/share/icingaweb2/modules/grafana/library/Grafana/ProvidedHook/Grapher.php on line 221



  • This is caused by the missing curl PHP extension. Install that extension. On Debian Linux for instance, do the following:


    Code
    1. apt-get install php-curl


    then you might need to reload or restart your apache process. I ran in the same problem and it was caused just by the missing php module.

  • I'll see if I can come up with a better error message in a PR. I had a similar code snippet when integrating Github releases with curl somewhere.

  • hello,


    Thanks to @davidsch and @dnsmichi for your feedback, after php-curl was installed, the new error comes.

    grafana module version is v1.1.7 and my OS is ubuntu 16.04



    First parameter must either be an object or the name of an existing class


  • hello Mikesch


    [grafana]

    host = "127.0.0.1:3000"

    protocol = "http"

    height = "280"

    width = "640"

    enableLink = "yes"

    defaultdashboard = "icinga2-default"

    defaultdashboardstore = "db"

    datasource = "influxdb"

    accessmode = "proxy"

    shadows = "1"

    theme = "light"

    authanon = "yes"

    usepublic = "no"


    I followed below instruction to integrate grafana module.


    Thanks

  • hello Mikesch


    enabled anonymous auth in grafana and new error comes.

    [auth.anonymous]

    enabled = true

    #org_name = Koebbes

    #org_role = Viewer





    Thanks

    The post was edited 1 time, last by qd_056 ().

  • and if I specify the org name and role,


    [auth.anonymous]

    enabled = true

    org_name = Koebbes

    org_role = Viewer


    error message shows as below



    First parameter must either be an object or the name of an existing class