Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Disable Graph" feature seems broken #111

Closed
GalipoliX opened this issue Jan 21, 2018 · 19 comments
Closed

"Disable Graph" feature seems broken #111

GalipoliX opened this issue Jan 21, 2018 · 19 comments

Comments

@GalipoliX
Copy link

GalipoliX commented Jan 21, 2018

Expected Behavior

Setting a variable "grafana_graph_disable" to any value (in this case true) should disable the graph rendering for the matching service.

Current Behavior

Graph still shown without data (No data points).

Context

This is an example config:

apply Service "NRPE" {
import "check_nrpe_alive"

assign where host.vars.os == "windows"
vars.grafana_graph_disable = true
import DirectorOverrideTemplate

##Environment

  • Icinga Web 2 Grafana version: 1.1.10
  • Icinga Web 2 version: 2.50
  • Version used: r2.8.1-1
  • Operating System and version: Ubuntu 16.04.3 LTS
  • Enabled features: api checker debuglog ido-mysql influxdb mainlog notification perfdata
  • Config validation: All valid
@Mikesch-mp
Copy link
Owner

Just tested it and it works like it should be. "grafana_graph_disable" only works if you didnt set another variable in the module config. Can you please provide your config.ini of the module.

Regards,
Carsten

@GalipoliX
Copy link
Author

GalipoliX commented Jan 22, 2018

Sure. Here it is:

[grafana]
host = "graph.:3000"
protocol = "http"
defaultdashboard = "icinga2-default"
defaultorgid = "1"
shadows = "1"
defaultdashboardstore = "db"
theme = "dark"
datasource = "influxdb"
accessmode = "proxy"
debug = "1"
height = "280"
width = "1024"
enableLink = "yes"
authanon = "no"
username = "admin"
password = "secret"
usepublic = "no"
timerange = "12h"

No custom variable defined.

@Mikesch-mp
Copy link
Owner

Hmm really strange. Will do another test tomorrow.

@GalipoliX
Copy link
Author

I guess that something went wrong with the vars deployed by icinga director. I will do further research tomorow.

@GalipoliX
Copy link
Author

I tried a few things but i cant get this to work again.
If i inspect the service in the gui the var is there:

type: "Service",
vars: {
grafana_graph_disable: "yes",
param1: "$host.vars.blub$",
param2: "param2",
param3: "param3"
},

but the graph is still beeing shown :(

Any ideas ?

@ghost
Copy link

ghost commented Feb 1, 2018

Works for me like a charm too.
Can you try to define vars.grafana_graph_disable as an boolean in your director configuration?

Here my working configuration:

Service Example

apply Service "Interface Status - " for (config in host.vars.interfaces) {
    import DirectorOverrideTemplate
    ...
    vars.grafana_graph_disable = true
    assign where host.vars.interfaces
}

grafana/config.ini

[grafana]
host = "localhost:3000"
protocol = "http"
defaultorgid = "1"
shadows = "0"
defaultdashboardstore = "db"
theme = "light"
datasource = "graphite"
accessmode = "proxy"
height = "300"
width = "660"
enableLink = "yes"
debug = "1"
defaultdashboard = "graphite-icinga2-default"
usepublic = "yes"
publichost = "myhostname/grafana"
publicprotocol = "https"
authanon = "yes"

Environment
Icinga Web 2 Grafana version: 1.1.10
Icinga Web 2 version: 2.5.0
Icinga2 version: r2.8.1-1
Operating System and version: CentOS Linux release 7.4.1708 (Core)
Enabled features: api checker command graphite ido-mysql livestatus mainlog notification
Config validation: All valid

Best regards,
Marcel

@GalipoliX
Copy link
Author

I reinstalled the complete grafana module and started with a clean /etc/icingaweb2/modules/grafana directory.
I also deleted the disable_grafana_graph var in director.

Then i recreated it with type boolean an added it to one of my service templates.
After this i set the var to true in my ServiceSet.

The graph is still there :(
If i inspect the service in icingaweb2 the var is visible:

type: "Service",
vars: {
  grafana_graph_disable: true,
  nrpe_arguments: [
    "advertising",
    "verbose"
  ],

Any chance of debugging this on my side ?

@Mikesch-mp
Copy link
Owner

Give me some more days. Iam rewriting some debugging features.

@GalipoliX
Copy link
Author

Yeah sure! Thanks for your help!!!!

@Mikesch-mp
Copy link
Owner

Hi @GalipoliX ,

please clone the 1.2.0 branch, there i added the 'brand new' :) debug feature.

Best regards,
Carsten

@GalipoliX
Copy link
Author

Hey,
the debug feature tells me:

Disable graph custom variable | grafana_graph_disable-- | --

But the graph is still there.

:(

@Mikesch-mp
Copy link
Owner

@GalipoliX

iam getting out of ideas. If you want we can do a teamviewer/skype session so i can directly see the output and whats going maybe wrong.

@GalipoliX
Copy link
Author

@Mikesch-mp
sorry for not replying. Had been some busy weeks.
Today i got time to analyze the troblem. It seems that the Grapher.php is unable to read the custom vars.
The Debugging feature shows none.
I added "var_dump($customVars);" to line 486 in Grapher.php and the result is: array(0) { }

So it cant trigger. Is there anything that blocks the access to the vars?

Any Idea with this new information? Sure we can do a teamviewer/skype session.
You can contact me when you have time (michael@geschwinder.net)

Thanky for your help!

@Mikesch-mp
Copy link
Owner

I found the problem, boolean in customvars are not real boolean. Have to trick convert them first ...

@Mikesch-mp Mikesch-mp added this to the 1.2.5 milestone May 30, 2018
@Mikesch-mp
Copy link
Owner

@killepitisch and @GalipoliX
can you please test the latest master and report if it is working now for you or not

@killepitisch
Copy link

killepitisch commented Jun 1, 2018

@Mikesch-mp Release 1.2.5 works fine for me, thx!

@GalipoliX
Copy link
Author

I think you can close this Ticket. My Icingaweb2 Installation themes broken in some kind.
Have some strange behaviour.
I installed Icingaweb2 and the Grafana Module on a different Server and pointed it to the same IDO Database. The result is that everything works as expected.

Thanks for your help!

@GalipoliX
Copy link
Author

GalipoliX commented Jun 2, 2018

Sry to correct me here but i tracked ist down further more.
This issue only occurs if i access the icingaweb2 page via apache2 vhost.
I have some other issuses with this, for example in the left sidebar the number off host and service issues is allways purple and shows one issue.

I used the vhost Configuration described in the icingaweb2 documentation.

Can you confirm that there is an issue ?

Edit:
It also happens if i access the site with an DNS entry (no vhost). Only IP address seems to work as expected.

@GalipoliX
Copy link
Author

I finally found the issue!
It was this:
https://monitoring-portal.org/t/host-problems-flag-showing-despite-no-actual-host-problems/2638/10

An error in the roles.ini caused all of my problems.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants