Code Monkey home page Code Monkey logo

icingaweb2-module-grafana's Introduction

Grafana Module for Icinga Web 2

Table of Contents

  1. About
  2. License
  3. Support
  4. Requirements
  5. Documentation
  6. Contributing
  7. Donations

About

Add Grafana graphs into Icinga Web 2 to display performance metrics.

License

Icinga Web 2 and this Icinga Web 2 module are licensed under the terms of the GNU General Public License Version 2, you will find a copy of this license in the LICENSE file included in the source package.

Support

Join the Icinga community channels for questions.

Requirements

Documentation

You can find the complete documentation inside the doc folder.

Thanks

This module borrows a lot from https://github.com/Icinga/icingaweb2-module-generictts & https://github.com/Icinga/icingaweb2-module-pnp.

Contributing

There are many ways to contribute to the Icinga Web module for Grafana -- whether it be sending patches, testing, reporting bugs, or reviewing and updating the documentation. Every contribution is appreciated!

Please continue reading in the contributing chapter.

icingaweb2-module-grafana's People

Contributors

benschweizer avatar dh-harald avatar eifoen avatar epinter avatar flourish86 avatar friesoft avatar jonbulica99 avatar koelle25 avatar lippserd avatar mafri27 avatar mcktr avatar mikesch-mp avatar mkayontour avatar nbuchwitz avatar nilmerg avatar phibos avatar raviks789 avatar xam-stephan avatar xbulat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

icingaweb2-module-grafana's Issues

Display more than one graph per service

First of all: Thanks for writing this awesome module! I appreciate your work!

There is a request regarding the service graphs:
We display a graph from Grafana when viewing a service within Icingaweb2.
We would not like to have only one graph, but to have multiple graphs per service, all displaying different time frames:

  • Last hour
  • Last day
  • Last week
  • Last month (30 days)
  • Last year (365 days)

In addition, there is a request for extending this: Instead of displaying all graphs with a full size, we want to have a small thumbnail preview and when mouse-overing them, the full-size graph should be shown.

I patched your module in a customer installation to display 5 graphs for a service, and it works great. Unfortunately loading the service tab is now really slow since my modification makes your module request 5 images from Grafana, which is really slow.

I therefore would like to know what you, the author, thinks about this request and how one could optimize loading times then. One idea would be to make the module more intelligent by e.g. caching images for a configurable interval (or even pre-fetching them, if wanted). Or one could argue if graphs for a long time range (e.g. for the last year) really need to be refreshed every time someone loads the service tab.

Graph render performance slow

We are experiencing slow render performance (2-3 sec) for graphs with default values:

Graph height The graph height in pixel, default: 280
Graph width The graph width in pixel, default : 640
Timerange The global time range for the graphs, default: 6h

We are fetching the graphs from localhost.
how can the the render time be improved?
Is it solely depending on grafana? or graphite?

(we activated render logging in graphite, takes usualle 0,00x seconds for graphite to render - so much overhead lost on the way?)

Thanks!

Feature Request: Use iframe src instead of rendering the preview

In the current configuration Grapher.php creates a PNG using the render function of Grafana. An image is static.
It would be nice to use iframe src= to have a more dynamic graph. The problem with iframe might be the authentication. Basic authentication seems not to work very well with iframes. There might be a workaround using javascript to send the authentication headers.

Possibility to add more then one graph

Hi,

It would be nice if we have the possibility to add more than one graph to a service (manually via "Add New Grafana Graph"). This could be useful for services with different metric types.

For example ping4 has:

  • rta = ms
  • pl = %

Grafana did not show the configuration Menu

After trying it on a test system some days ago, I would add it to the real system.
After cloning the git rep and also restarting grafana-server, icinga2 and apache2 is no configuration Menu available.
As i recognized, you changed something before 4 days.
So any Hints, what I can do?

Thanks in advanced,
Fiiti

Feature request: Show all graphs from host

So currently you can see the graphs per service when you click on the service, but it would be very great if there would be a button or drop down menu to choose if you would like to show all graphs from the specific host underneath each other.

Personally I have hacked this into icingaweb2 with custom php files which is very very ugly, but it looks like this:

http://shot.xsnews.nl/stefan/e605b8a9e04d11dd.png

And when you click on All Graphs:

http://shot.xsnews.nl/stefan/dc6dc121c5ed47ed.png

It simply just loops trough all the host its services, and show them one by one.

I suggest some kind of show/hide div which will load after clicking it, because loading these graphs take a bit of time it will otherwise make the service information come very late.

something like this:

http://shot.xsnews.nl/stefan/3684d8b7c842052f.png

http://shot.xsnews.nl/stefan/3605bddd41e76e11.png

So basicaly what I would like is whenever you are on the host tab (not service tab), be able to click something and show every single graph from that specific host.

multiple panelid's give error

Thank you for writing this module, its awesome!

One error that I get when using multiple panel id's:

sprintf(): Too few arguments

#0 [internal function]: Icinga\Application\ApplicationBootstrap->Icinga\Application\{closure}(2, 'sprintf(): Too ...', '/usr/share/icin...', 301, Array)
#1 /usr/share/icingaweb2/modules/grafana/library/Grafana/ProvidedHook/Grapher.php(301): sprintf('<a href="http:/...', 'http', 'icinga.xsnews.i...', 'db', 'icinga2-dfeedin...', 'abp003', 'dfeedinfo-infee...', '6h', '<img src="http:...')
#2 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\Service))
#3 /usr/share/php/Icinga/Web/View.php(231): include('zend.view:///us...')
#4 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(877): Icinga\Web\View->_run('/usr/share/icin...')
#5 zend.view:///usr/share/icingaweb2/modules/monitoring/application/views/scripts/partials/object/detail-content.phtml(3): Zend_View_Abstract->render('show/components...')
#6 /usr/share/php/Icinga/Web/View.php(231): include('zend.view:///us...')
#7 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(877): Icinga\Web\View->_run('/usr/share/icin...')
#8 zend.view:///usr/share/icingaweb2/modules/monitoring/application/views/scripts/service/show.phtml(25): Zend_View_Abstract->render('partials/object...')
#9 /usr/share/php/Icinga/Web/View.php(231): include('zend.view:///us...')
#10 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(877): Icinga\Web\View->_run('/usr/share/icin...')
#11 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(904): Zend_View_Abstract->render('service/show.ph...')
#12 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(925): Zend_Controller_Action_Helper_ViewRenderer->renderScript('service/show.ph...', NULL)
#13 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(964): Zend_Controller_Action_Helper_ViewRenderer->render()
#14 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/HelperBroker.php(272): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#15 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(518): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#16 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch('showAction')
#17 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#18 /usr/share/php/Icinga/Application/Web.php(389): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#19 /usr/share/php/Icinga/Application/webrouter.php(109): Icinga\Application\Web->dispatch()
#20 /usr/share/icingaweb2/public/index.php(4): require_once('/usr/share/php/...')
#21 {main}

Proposal: url and publicUrl config settings

Proposal:

  1. Introduce a config setting [grafana] -> url, superseding & deprecating protocol and host.
    From what I can see, the only uses of the current settings involve merging them into a URL. Also, host can be set to server.name:1234/path, which is even less of a "host" than server.name:1234.

    If url isn't set, it should default to ${protocol}://${host}.

  2. Introduce an optional config setting [grafana] -> publicUrl. If unset, it should default to the value of url.

    This should be used for embed URLs in direct mode as well as the graph links in proxy mode.

These settings would allow a configuration like:

[grafana]
url = "http://localhost:3000"
publicUrl = "https://icingaweb2.host.name/grafana"
accessmode = "proxy"
enableLink = "yes"

to serve proxied graphs quicker (no SSL overhead) while presenting "proper" URLs for links to grafana dashboards.

I think a lot of installs out there would benefit from such a configuration.

Unable to import json dashboards

When I try to prepare grafana for use with this module I understand it is necessary to import the dashboards given (icinga2-default, base-metrics).
Do I have to edit them beforehand?
When I try to import the first an error message is given:

Dashboard init failed
Template variables could not be initialized: Datasource named ${DS_ICINGA2-GRAPHITE} was not found

I am a newbie with Graphite/Grafana - sorry if this has been said somewhere.

1.1.6 - Undefined variable: imgClass

Hi.

Just updated to 1.1.6.
Host and Service page show error:

#0 /usr/share/icingaweb2/modules/grafana/library/Grafana/ProvidedHook/Grapher.php(254): Icinga\Application\ApplicationBootstrap->Icinga\Application\{closure}(8, 'Undefined varia...', '/usr/share/icin...', 254, Array)
#1 /usr/share/icingaweb2/modules/grafana/library/Grafana/ProvidedHook/Grapher.php(357): Icinga\Module\Grafana\ProvidedHook\Grapher->getMyPreviewHtml('hostalive4', 'KOM-APP01...', '')
#2 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))
#3 /usr/share/php/Icinga/Web/View.php(231): include('zend.view:///us...')
#4 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(877): Icinga\Web\View->_run('/usr/share/icin...')
#5 zend.view:///usr/share/icingaweb2/modules/monitoring/application/views/scripts/partials/object/detail-content.phtml(3): Zend_View_Abstract->render('show/components...')
#6 /usr/share/php/Icinga/Web/View.php(231): include('zend.view:///us...')
#7 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(877): Icinga\Web\View->_run('/usr/share/icin...')
#8 zend.view:///usr/share/icingaweb2/modules/monitoring/application/views/scripts/host/show.phtml(14): Zend_View_Abstract->render('partials/object...')
#9 /usr/share/php/Icinga/Web/View.php(231): include('zend.view:///us...')
#10 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(877): Icinga\Web\View->_run('/usr/share/icin...')
#11 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(904): Zend_View_Abstract->render('host/show.phtml')
#12 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(925): Zend_Controller_Action_Helper_ViewRenderer->renderScript('host/show.phtml', NULL)
#13 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(964): Zend_Controller_Action_Helper_ViewRenderer->render()
#14 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/HelperBroker.php(272): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#15 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(518): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#16 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch('showAction')
#17 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#18 /usr/share/php/Icinga/Application/Web.php(389): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#19 /usr/share/php/Icinga/Application/webrouter.php(109): Icinga\Application\Web->dispatch()
#20 /usr/share/icingaweb2/public/index.php(4): require_once('/usr/share/php/...')
#21 {main}

custom vars missing in link url

hello mikesch,

could you include the custom variables in the image link url, please? because of the missing vars i can't immediately jump to the right graphs.

grafana-icingaweb2

grafana-graph

here is the graphs.ini for my snmp-interface-custom command (extended check_snmp_int.pl):

[snmp-interface-custom]
dashboard = "icinga2"
panelId = "3"
customVars = "&var-snmpinterface=$snmp_interface$_in_bps&var-snmpinterface=$snmp_interface$_out_bps"

regards

Only timeperiods being displayed

Hello,

firstly I have no experience with Grafana or Graphite, only wanted graphs in Icinga2. So I have setup the module according to the guide and Grafana/Graphite with Docker. However I do not get any graphs in the web frontend. I only get a line with timeperiods below the plugin output:

5 minutes : 15 minutes : 30 minutes : 1 hour : 3 hours : 6 hours : 8 hours : 12 hours : 24 hours : 2 days : 7 days : 30 days : 60 days : 6 months : 1 year : 2 years

Also I could not really understand where the data for the graphs comes from in the guide. From my understanding the data of the plugins (for example load values) would have to be put into graphite first somehow, wouldnt it?

Sorry if this is a dumb question and you just have to be a Graphite/Grafana pro to use this module.

Kind regards

Parse error: syntax error, unexpected '[' in Grapher.php

Just tried latest checkout with icingaweb2 2.4.1 and grafana 4.3.1

Parse error: syntax error, unexpected '[' in /usr/share/icingaweb2/modules/grafana/library/Grafana/ProvidedHook/Grapher.php on line 156

My grafana module config:

[grafana]
host = "10.10.0.100/grafana"
protocol = "http"
defaultdashboard = "icinga2-default"
defaultdashboardstore = "db"
datasource = "influxdb"
accessmode = "direct"
directrefresh = "no"
height = "280"
width = "640"
enableLink = "yes"
usepublic = "no"

Hostalive is not shown

The hostalive graph is not shown because of an invalid query.
I configured my InfluxdbWriter as described here:
https://docs.icinga.com/icinga2/latest/doc/module/icinga2/chapter/object-types

object InfluxdbWriter "influxdb" {
  host = "127.0.0.1"
  port = 8086
  database = "icinga2"
  host_template = {
    measurement = "$host.check_command$"
    tags = {
      hostname = "$host.name$"
    }
  }
  service_template = {
    measurement = "$service.check_command$"
    tags = {
      hostname = "$host.name$"
      service = "$service.name$"
    }
  }
}

Result:

> SHOW TAG KEYS FROM "nrpe";
name: nrpe
tagKey
------
hostname
metric
service

> SHOW TAG KEYS FROM "hostalive";
name: hostalive
tagKey
------
hostname
metric

=> hostalive does not have a tagKey service.

For a host the module generates the query including "service =~ /^hostalive$/" like

SELECT mean("value") FROM /^$/ WHERE "hostname" =~ /^MyHost$/ AND "service" =~ /^hostalive$/ AND "metric" =~ /^$/ AND time > now() - 6h GROUP BY time(15s) fill(none)

This works for services like nrpe, but not for hostalive because it has different tagKeys
Correct is

SELECT mean("value") FROM /^hostalive$/ WHERE "hostname" =~ /^MyHost$/ AND "metric" =~ /^rta$/ AND time > now() - 6h GROUP BY time(15s) fill(none)

The URL has to be changed:
/dashboard/db/icinga2-default?var-hostname=MyHost&var-command=hostalive&var-service&from=now-6h&to=now&orgId=1

I've a fix for it and will open a pull request.

feature: per user settings

It would be awesome to be able to use per user settings so we can personally choose between iframe / direct or proxy.

(not sure if its possible because they are 'general' module settings)

1.1.5 - No more scaling of the graph size ?

Hello, Mikesch-mp

In version 1.1.4 was a good scaling of the graph size (graph is dynamically reduced).
Also was beautiful (in my opinion) shadow borders for graphics.

view114

In version 1.1.5 it's all gone.

view115

Why?

Possibility to change refresh time

Hi hi, ๐Ÿ˜„

It would be nice to be able to change the refresh time of the graph.
If I look inside the logs, I can see that the current graph is rendered every 10 seconds (approx).
In a way, it is nice to get fresh values. However it creates some traffic that I don't necessarily need.

What I ask for is the possibility to enable or not the refresh of graphs.
So when I click on a host/service I get a "screenshot" of the graph than isn't dynamically refreshed.

Regards and thx for your work :-)

t=2017-03-27T10:59:09+0200 lvl=info msg=Rendering logger=png-renderer path="dashboard-solo/db/icinga2-default?var-hostname=fro1vmonitor2&var-service=hostalive&panelId=2&width=640&height=280&theme=light&from=now-30m&to=now"
t=2017-03-27T10:59:21+0200 lvl=info msg=Rendering logger=png-renderer path="dashboard-solo/db/icinga2-default?var-hostname=fro1vmonitor2&var-service=hostalive&panelId=2&width=640&height=280&theme=light&from=now-30m&to=now"
t=2017-03-27T10:59:32+0200 lvl=info msg=Rendering logger=png-renderer path="dashboard-solo/db/icinga2-default?var-hostname=fro1vmonitor2&var-service=hostalive&panelId=2&width=640&height=280&theme=light&from=now-30m&to=now"
t=2017-03-27T10:59:44+0200 lvl=info msg=Rendering logger=png-renderer path="dashboard-solo/db/icinga2-default?var-hostname=fro1vmonitor2&var-service=hostalive&panelId=2&width=640&height=280&theme=light&from=now-30m&to=now"
t=2017-03-27T10:59:55+0200 lvl=info msg=Rendering logger=png-renderer path="dashboard-solo/db/icinga2-default?var-hostname=fro1vmonitor2&var-service=hostalive&panelId=2&width=640&height=280&theme=light&from=now-30m&to=now"

Feature request: All panels

Would love to see a wildcard possibility with the "PanelId(s)" option.

For example I have a dashboard with the following templatings:

$host = SHOW TAG VALUES FROM "filesystems" WITH KEY = "hostname"
$filesystem = SHOW TAG VALUES FROM "filesystems" WITH KEY = "metric" WHERE hostname =~ /$host/

Which means for each host there is a different number of panels available for this dashboard, and because its hardcoded now I can not use the grafana module for this specific dashboard.

If a wildcard (*) option would exist, it would check with grafana how many panels there are and just show them all.

Currently I have a very ugly way with my hacked grafana graph version to loop through the dashboard this way:

/usr/bin/curl http://icinga:3000/api/dashboards/db/icinga2-filesystems 2> /dev/null | python -m json.tool | sed -n -e '/panels/,$p'| grep '"id"' | grep -o [0-9]*

This will list the panel numbers:

root@icinga:/# /usr/bin/curl http://icinga:3000/api/dashboards/db/icinga2-filesystems 2> /dev/null | python -m json.tool | sed -n -e '/panels/,$p'| grep '"id"' | grep -o [0-9]*

1
2
3
4
5
6
7
8

Maybe you are able to find a better and easier way to query grafana for this information?

No datapoints when host check_command = icmp

Hi Mikesch,
after seeing your module at Icinga Camp yesterday, I also want to try it.
So I use ICMP instead of hostalive for host checks. Sadly, I get an empty grafana graph on the host overview page with "no datapoints". Also after changing host check_command to hostalive, I don't get a graph. Can you give me a hint how to fix this? I am currently new in this
grafana stuff :D

Thanks in advance

Marcus

screeny

Feature request - grafana graphs names wildcards specifications

Hi
I am using grafana module for couple of weeks now and I am generally happy with it as it is very useful module, I simply did not find anything with such possibilities yet.
I have one feature request (at least i did not find a way how to do this myself).
I have this situation:
We have multiple similar services that are checking similar stuff but they are named differently (also their check commands are), e.g. oracle-tablespace-usage-TEST / oracle-tablespace-usage-STAGE / oracle-tablespace-usage-PROD, they all use same graph but I have to define 3 different graphs inside icingaweb.

It would be very handy if the module understand that if I define e.g.: oracle-tablespace-usage-* it would basically use such graph for any services matching this wildcard.

Regards David

disable graphs at service manually or automatic?

Hi there,

is there anything implemented which allows me to disable graphs for a specific service?
Would be great to disable some service instead of having a empty.
empty-graph

I'm not a developer otherwise i would implement something and contribute.

Module dont show labels or text in Icingaweb2

Hi Mikesch,
i successfully installed your module.
It shows the Graph but no Labels or Text.
I tried following:
Install curl - already installed
Change Grafana Theme from dark to light
Other Browser - Same issue
What did i wrong?
In icingaweb2 it looks like:
grafik
On the Grafana Board it looks like this:
grafik

Work alongside pnp Module

Hi just a question or request.. is it possible to make this module work alongside the pnp module?

Provide metric as render parameter + display all panels

Hi,

we have many services which generate a variable amount of perfdata, depending on the host. We would like to graph each of these metrics in its own graph. Example: one service to check disk space on all partitions - each partition is a seperate metric with value, min, max, warn, ...

We would like to have:
Service DISK

  • Graph: /home
  • Graph: /usr
  • Graph: /var/log
  • Graph: /tmp

Currently this isn't possible as in Grafana we can't repeat the panel on each metric - only on each service.

To make this possible we would need:

  • an url parameter &var-metric=<METRIC_NAME>
  • the possibility to display all panels of a dashboard

Thanks & Best regards
Bernhard Friedreich

Missing Grafana host configuration results in Undefined property: Icinga\Module\Grafana\ProvidedHook\Grapher::$view

The latest addition of the timerange qlink breaks Icinga Web 2.

  • CentOS7, SELinux is disabled
  • Module is just a git clone (master, v1.0.10) and enabled, no configuration applied yet
  • Icinga Web 2: icingaweb2-2.4.0-2.snapshot201704192326.el7.centos.noarch
Undefined property: Icinga\Module\Grafana\ProvidedHook\Grapher::$view

#0 /usr/share/icingaweb2/modules/grafana/library/Grafana/ProvidedHook/Grapher.php(142): Icinga\Application\ApplicationBootstrap->Icinga\Application\{closure}(8, 'Undefined prope...', '/usr/share/icin...', 142, Array)
#1 /usr/share/icingaweb2/modules/grafana/library/Grafana/ProvidedHook/Grapher.php(249): Icinga\Module\Grafana\ProvidedHook\Grapher->getTimerangeLink(Object(Icinga\Module\Monitoring\Object\Service), '5 minutes', '5m')
#2 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\Service))
#3 /usr/share/php/Icinga/Web/View.php(231): include('zend.view:///us...')
#4 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(877): Icinga\Web\View->_run('/usr/share/icin...')
#5 zend.view:///usr/share/icingaweb2/modules/monitoring/application/views/scripts/partials/object/detail-content.phtml(3): Zend_View_Abstract->render('show/components...')
#6 /usr/share/php/Icinga/Web/View.php(231): include('zend.view:///us...')
#7 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(877): Icinga\Web\View->_run('/usr/share/icin...')
#8 zend.view:///usr/share/icingaweb2/modules/monitoring/application/views/scripts/service/show.phtml(8): Zend_View_Abstract->render('partials/object...')
#9 /usr/share/php/Icinga/Web/View.php(231): include('zend.view:///us...')
#10 /usr/share/icingaweb2/library/vendor/Zend/View/Abstract.php(877): Icinga\Web\View->_run('/usr/share/icin...')
#11 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(904): Zend_View_Abstract->render('service/show.ph...')
#12 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(925): Zend_Controller_Action_Helper_ViewRenderer->renderScript('service/show.ph...', NULL)
#13 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/Helper/ViewRenderer.php(964): Zend_Controller_Action_Helper_ViewRenderer->render()
#14 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action/HelperBroker.php(272): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#15 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(518): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#16 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch('showAction')
#17 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#18 /usr/share/php/Icinga/Application/Web.php(389): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#19 /usr/share/php/Icinga/Application/webrouter.php(104): Icinga\Application\Web->dispatch()
#20 /usr/share/icingaweb2/public/index.php(4): require_once('/usr/share/php/...')
#21 {main}

master broken due to typo

Current master has a typo in library/Grafana/ProvidedHook/Grapher.php, line 192 ($this-timeout -> $this->timeout).

Add New Grafana Graph Question

Hi,
I am not pretty sure to understand all functions.
Must I add by myself ALL Grapfs in the Graphs Menu I would like to see by the service ?
I mean the "Add New Grafana Graph".

Or for what is this feature?

It seems, that a lot of Graphs are available, without adding a Graph (mem, ping, hostalive, ...)

Thanks in advanced
Fiiti

png preview files not generated...

Not sure if issues, am running:

Ubuntu 16.04.02
Icinga2.6.2-1
Icinga2Web 2.4.1
Grafana 4.1.2
Graphite
IcingaWeb2-Module-Grafana 1.0.3

I was able to follow the steps in the README successfully and can see (Windows and LocalHost) data in Grafana. I am able to click on generated preview images in Icinga (to access the relevant Grafana graph.

  1. The links on the preview images did not work correctly (or in my case, I'm using anonymous access to Grafana. I needed to change the URL in Grapher.php (line 80) from:

'%s://%s%s/render/dashboard-solo/db/%s?var-hostname=%s&var-service=%s&panelId=%s&width=%s&height=%s&theme=light&from=now-%s&to=now',

To:

'%s://%s%s/dashboard/db/%s?var-hostname=%s&var-service=%s&panelId=%s&width=%s&height=%s&theme=light&from=now-%s&to=now',

When I clicked the link, I would get page could not be displayed). After correcting the URL in Grapher.php, when I now click the links, they open correctly in Grafana, see screenshot 1.

  1. However, the preview links are still not rendering in Icinga, see screenshot 2.

Think this may be an issue localized to my installation. Have so far tried to install libpng-dev but with no luck.

(Note I had previously been testing with icingaweb2-module-graphite, in this case I was able to get previews working correctly in Icinga Web.)

grafanapreview

previewoutput

Proxy mode with curl might fail with SELinux enabled

The curl_error() handling wasn't fully patched in #33 and I've also encountered an issue with curl_errno() == 7 which results in 'permission denied'. After googling a while this led me to SELinux, yay.

It's a common problem on CentOS, and the error message can be improved. I'll send a PR soon.

Docs: Provide a code snippet for config.ini

Mainly a documentation issue, I don't know how to exactly put that into /etc/icingaweb2/modules/grafana/config.ini. Would be helpful as well to get a step-by-step setup documentation.

Change graph size when adding new Graphana Graphs

Hi with adding new graphs using the "Add New Grafana Graph" option would it be possible to add the ability to override the configuration width and height for each custom graph, or can i do that maunually from within the config file?

How to select which variables will be displayed on service graph?

Good day:

How can I select wich variable will be displayed on service graph? I made a custom icinga check_plugin and this plugin display a lot of variables, the service graph shows timestamp :-(

screenshot at 2017-06-09 11-03-28
There is a way to configure this graphs?

Thanks in advance
Nomar

Flexible timerange menu

New timerange menu is good, but lacks flexibility.
Can you implement the possibility to select intervals, for example, using the two fields?

  1. Units (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 15, 20, 30, 45, 60)
  2. Periods (minutes, hours, days, weeks, months, years)

This link will form depending on the selected values.

Do You like this idea?

Proxy mode always returns 401

70a61a3 introduces a bug with curl and "proxy" mode. $this->auth is initialized to "username:password@". This always results in a 401.

The error handling isn't correct either, I'll submit a PR for both aspects soon.

Proposal: Issue Milestones, Labels, Styleguide, Contributing, Changelog

Your module is becoming quite popular, and since I've started to add my PRs too, I just wanted to suggest certain organizational things:

Milestones

Labels

  • Assign enhancement/bug labels to newly created issues (you as the owner can do it, but no-one else)
  • Add more labels and coloring (e.g. Grafana, Graphite, InfluxDB, Configuration, Documentation) to selectively view and organize issues.

Styleguide

I'd suggest to apply the same code style guide as known from Icinga Web 2. Such a thing could be implemented into travis-ci tests which are checked on each PR too.

Contributing

Add a CONTRIBUTING.md file which explains contributions and PRs. We've recently started to apply this to Icinga 2, might be worthwhile to do the same (this also involves uses milestones for the roadmap).
https://github.com/Icinga/icinga2/blob/master/CONTRIBUTING.md

Changelog

Once you've settled issues with milestones, you can automatically generate a CHANGELOG.md file from that. Follow these instructions: https://github.com/Icinga/puppet-icinga2/blob/master/RELEASE.md#2-changelog

Proposal/Wish: Add a configuration switch for the theme/style

Hello Carsten,

first of all: great work! I really like your module.

This is gonna be really subjective. With the last update you added a shadow around the graph. I am not really a fan of those shadows, I liked the 'flat' style you've had before.

Maybe there are some other people who think like me. If you add an switch in the configuration tab to choose the style of the graph you would made both happy, people who like the shadow and those who dont.

Cheers

Proxy mode error handling with curl is buggy and not verbose enough

If you set HTTP_RETURNTRANSFER to true, you'll also need to check the returned result being false. curl_error($curl_handle) isn't always correct about it.

While at it, there also is a proper handling for the returned http status code missing. Everything greater than 299 must be treated as error.

I'll send a PR for handling such soon. This will also include Util class to help translate http status codes to string messages.

Move installation, configuration, etc. to doc/ and link over there.

I'm thinking about the following structure

  • 01-About.md
  • 02-Installation.md
  • 03-Configuration.md
  • 10-Advanced.md
  • 11-Grafana.md

or similar.

This allows us to keep the README.md file clean.

Expected Behavior

Clean documentation structure which allows for enhancements and community patches.

Current Behavior

README.md is a bit bloated.

Possible Solution

Introduce doc/ and look into Icinga 2's documentation.

Further we can add mkdocs for quick documentation edits and local tests.
This can be added to CONTRIBUTING.md then too.

Wildcard operator to define custom graphs

We have several icinga2 services that all have the following name: [location]_googledns_ping4

It would be nice if we could define a custom graph with a wildcard operator (or regex?). Such as:
grafik

Timerange menu - Service not found

Hi

I just upgraded to version 1.0.9 and tried to use links in timerange menu.
The use of any links causing the error

Service not found

#0 /usr/share/php/Icinga/Exception/IcingaException.php(41): ReflectionClass->newInstanceArgs(Array)
#1 /usr/share/php/Icinga/Web/Controller.php(78): Icinga\Exception\IcingaException::create(Array)
#2 /usr/share/icingaweb2/modules/monitoring/application/controllers/ServiceController.php(36): Icinga\Web\Controller->httpNotFound('Service not fou...')
#3 /usr/share/php/Icinga/Web/Controller/ActionController.php(139): Icinga\Module\Monitoring\Controllers\ServiceController->init()
#4 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(59): Icinga\Web\Controller\ActionController->__construct(Object(Icinga\Web\Request), Object(Icinga\Web\Response), Array)
#5 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#6 /usr/share/php/Icinga/Application/Web.php(389): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))
#7 /usr/share/php/Icinga/Application/webrouter.php(109): Icinga\Application\Web->dispatch()
#8 /usr/share/icingaweb2/public/index.php(4): require_once('/usr/share/php/...')
#9 {main}

I suspect that this is due to the fact that in my case the hostname in Icinga in the form of FQDN.

When I choose a period, then in the browser address bar the end of the url changes from this
/show?host=KOM-AD01-APP30.holding.com&service=SSH
to this
/show?host=KOM-AD01-APP30_holding_com&service=SSH&timerange=5m

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.