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

Custom Vars don't get escaped when send over to grafana #186

Closed
mkayontour opened this issue Oct 17, 2018 · 4 comments
Closed

Custom Vars don't get escaped when send over to grafana #186

mkayontour opened this issue Oct 17, 2018 · 4 comments
Assignees
Labels
Milestone

Comments

@mkayontour
Copy link

I'm using a custom variable var-diskwindows=$win_disk_path$ which values are windows disks.
win_disk_path = "F:"

When the variable is added to the url the variable won't be escaped so that graphite api can find the data.

var-hostname=host.fqdn&var-service=Windows_Disk_F_DB&var-command=disk-windows&var-diskwindows=F:

But to find the real value for the check the variable needs to get escaped in the graphite way.

var-hostname=host.fqdn&var-service=Windows_Disk_F_DB&var-diskwindows=F:_

Expected Behavior

Escape the value of the variable

Current Behavior

Does not ;P

Steps to Reproduce (for bugs)

Use the Windows Disk check for single partitions and try to point it to single disk in grafana.

Your Environment

  • Icinga Web 2 Grafana version (System - About): 1.3.1
  • Icinga Web 2 version and modules (System - About): 2.6.1
  • Version used (icinga2 --version): 2.10.0
  • Operating System and version: Ubuntu 18.04
@Mikesch-mp
Copy link
Owner

Hello,

did you try it with f:\, so the \ gets replaced with _?

Regards,
Carsten

@mkayontour
Copy link
Author

Direct Copy Paste from the URL, unfortunately it doesnt work either.
var-hostname=host.fqdn&var-service=Windows_Disk_F&var-command=disk-windows&var-diskwindows=F:%5C

Url Encode will transform it into \ = %5C. And Graphite still needs "F:_"

@mkayontour
Copy link
Author

Found a workaround, &var-diskwindows=$disk_win_path$_ i've put the Char behind the marco, it works but if it will work in other Situations I'm not sure.

If you wan't to fix it I leave the issue open, otherwise you can close it.

@Mikesch-mp
Copy link
Owner

Let it open, i think i need to do the replacement before encoding the extra vars.

@Mikesch-mp Mikesch-mp added this to the 1.3.3 milestone Oct 18, 2018
@Mikesch-mp Mikesch-mp self-assigned this Oct 18, 2018
@Mikesch-mp Mikesch-mp added the bug label Oct 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants