Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Config parsing inconsistency regarding 'indirectproxyrefresh' #153

Closed
basg opened this issue May 7, 2018 · 5 comments
Closed

Config parsing inconsistency regarding 'indirectproxyrefresh' #153

basg opened this issue May 7, 2018 · 5 comments
Assignees

Comments

@basg
Copy link

basg commented May 7, 2018

It seems that the parsing of boolean values in the icingaweb2-module-grafana config.ini contains inconsistencies.

For items such as enableLink the value should be wrapped in quotes (`enableLinks = "yes") in order for the setting to be effective.

For the newly added indirectproxyrefresh item it seems that this setting will only be effective if the value is not wrapped in quotes. (so: indirectproxyrefresh = yes). This seems to be inconsistent with the other settings.

Expected Behavior

Set indirectproxyrefresh = "yes" stops graphs from rendering every 10 or so seconds.

Current Behavior

indirectproxyrefresh = "yes" does not yield any changes in the module's refreshing behavior, whereas indirectproxyrefresh = yes does.

Possible Solution

Ensure the parsing of boolean values in the configuration is consistent.

Steps to Reproduce (for bugs)

  1. Set indirectproxyrefresh = "yes"
  2. Observe the module, notice it refreshing more often than expected
  3. indirectproxyrefresh = yes
  4. Observe expected behavior in module

Your Environment

  • Icinga Web 2 Grafana version: 1.2.4
  • Icinga Web 2 version and modules (System - About): 2.5.3
  • Version used (icinga2 --version):r2.8.2-1
  • Operating System and version: CentOS 7
@Mikesch-mp
Copy link
Owner

Its not a bolean value, becaue themost users dont get it to set 0 or 1 (Zend does not use true/false) in the configuration.

How did you set it, using WebUI or directly with vi?

@Mikesch-mp Mikesch-mp self-assigned this May 7, 2018
@basg
Copy link
Author

basg commented May 7, 2018

Thanks for your response!

I set the value through vim. (indirectproxyrefresh = "yes")

The main point of my report was that i found it strange that in other config items the value seems to be accepted fine when surrounded by quotes, while for indirectproxyrefresh it is not.

@Mikesch-mp
Copy link
Owner

i have to test it, for me it works via webgui without problems.

@Mikesch-mp
Copy link
Owner

I did some changes and tests today. With this config

[grafana]
host = "192.168.178.52:3000"
protocol = "https"
defaultdashboard = "icinga2-default"
datasource = "influxdb"
accessmode = "indirectproxy"
theme = "light"
defaultorgid = "1"
debug = "1"
shadows = "0"
timerange = "6h"
timerangeAll = "1h"
defaultdashboardpanelid = "2"
version = "1"
ssl_verifypeer = "0"
ssl_verifyhost = "0"
authentication = "token"
height = "280"
width = "640"
enableLink = "yes"
usepublic = "no"
proxytimeout = "60"
apitoken = "eyJrIjoiSFRiYXRPSEZydFk3TmtGeFNyTjl4c0ZDSm45TUFZVk0iLCJuIjoiY3ZiY3ZiY3YiLCJpZCI6MX0="
defaultdashboarduid = "FxAre-ekz"
indirectproxyrefresh = "yes"

The graph gets refreshed more or less frequently (think its a browser thing)

May  9 22:40:42 koelin02 grafana-server: t=2018-05-09T22:40:42+0200 lvl=info msg=Rendering logger=png-renderer path="d-solo/aFE1d6gik/hostalive?var-hostname=koelin01.fritz.box&var-service=hostalive&var-command=hostalive&panelId=1&orgId=&width=640&height=280&theme=light&from=now-6h&to=now"
May  9 22:43:40 koelin02 grafana-server: t=2018-05-09T22:43:40+0200 lvl=info msg=Rendering logger=png-renderer path="d-solo/aFE1d6gik/hostalive?var-hostname=koelin01.fritz.box&var-service=hostalive&var-command=hostalive&panelId=1&orgId=&width=640&height=280&theme=light&from=now-6h&to=now"
May  9 22:44:43 koelin02 grafana-server: t=2018-05-09T22:44:43+0200 lvl=info msg=Rendering logger=png-renderer path="d-solo/aFE1d6gik/hostalive?var-hostname=koelin01.fritz.box&var-service=hostalive&var-command=hostalive&panelId=1&orgId=&width=640&height=280&theme=light&from=now-6h&to=now"
May  9 22:47:42 koelin02 grafana-server: t=2018-05-09T22:47:42+0200 lvl=info msg=Rendering logger=png-renderer path="d-solo/aFE1d6gik/hostalive?var-hostname=koelin01.fritz.box&var-service=hostalive&var-command=hostalive&panelId=1&orgId=&width=640&height=280&theme=light&from=now-6h&to=now"
May  9 22:48:45 koelin02 grafana-server: t=2018-05-09T22:48:45+0200 lvl=info msg=Rendering logger=png-renderer path="d-solo/aFE1d6gik/hostalive?var-hostname=koelin01.fritz.box&var-service=hostalive&var-command=hostalive&panelId=1&orgId=&width=640&height=280&theme=light&from=now-6h&to=now"
May  9 22:49:49 koelin02 grafana-server: t=2018-05-09T22:49:49+0200 lvl=info msg=Rendering logger=png-renderer path="d-solo/aFE1d6gik/hostalive?var-hostname=koelin01.fritz.box&var-service=hostalive&var-command=hostalive&panelId=1&orgId=&width=640&height=280&theme=light&from=now-6h&to=now"

if i set indirectproxyrefresh = "no" the refresh stops. It works no matter if i use WebUI or vim. Maybe you can test latest master and see if it is working for you now also.

@basg
Copy link
Author

basg commented May 11, 2018

Thanks for looking into this! I've tested the latest master and everything works as described for me too.

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

No branches or pull requests

2 participants