aggregate with y-label containing '#' fails in view #67

Closed
waxie opened this Issue Apr 12, 2012 · 8 comments

Comments

Projects
None yet
2 participants
@waxie

waxie commented Apr 12, 2012

When I make an aggregate graph which has a Y-axis label containing the "#" character, it works fine under the "Aggregate Graphs" tab.

However, if I add that graph to a "view" using the "+" button, it does not display properly anymore.

Removing the "#" from the Y-axis label in view_name.json fixes the issue.

Perhaps there is a escaping issue somewhere.

@ghost ghost assigned jbuchbinder Apr 12, 2012

@waxie

This comment has been minimized.

Show comment Hide comment
@waxie

waxie Apr 13, 2012

Great, thanks!

I will try to check it out today.

  • Ramon.

On 12-4-2012 21:23, Jeff Buchbinder wrote:

Should be fixed as of:

2e430eb

Please confirm.


Reply to this email directly or view it on GitHub:
#67 (comment)

ing. R. Bastiaans, B.ICT

  • Senior Systems Programmer
  • Operations, Support and Development

SARA
Science Park 140 PO Box 94613
1098 XG Amsterdam NL 1090 GP Amsterdam NL
P.+31 (0)20 592 3000 F.+31 (0)20 668 3167

waxie commented Apr 13, 2012

Great, thanks!

I will try to check it out today.

  • Ramon.

On 12-4-2012 21:23, Jeff Buchbinder wrote:

Should be fixed as of:

2e430eb

Please confirm.


Reply to this email directly or view it on GitHub:
#67 (comment)

ing. R. Bastiaans, B.ICT

  • Senior Systems Programmer
  • Operations, Support and Development

SARA
Science Park 140 PO Box 94613
1098 XG Amsterdam NL 1090 GP Amsterdam NL
P.+31 (0)20 592 3000 F.+31 (0)20 668 3167

@waxie

This comment has been minimized.

Show comment Hide comment
@waxie

waxie Apr 16, 2012

That commit does not fix the problem. Still does not work with # in vertical label.

waxie commented Apr 16, 2012

That commit does not fix the problem. Still does not work with # in vertical label.

@waxie

This comment has been minimized.

Show comment Hide comment
@waxie

waxie Apr 16, 2012

The problem is in view.php I think:

      $item_array = array( "aggregate_graph" => "true", "metric_regex" => $metric_regex_array,
        "host_regex" => $host_regex_array, "graph_type" => $_GET['gtype'],
        "vertical_label" => $_GET['vl'], "title" => $_GET['title'],
  "glegend" => $_GET['glegend']);

waxie commented Apr 16, 2012

The problem is in view.php I think:

      $item_array = array( "aggregate_graph" => "true", "metric_regex" => $metric_regex_array,
        "host_regex" => $host_regex_array, "graph_type" => $_GET['gtype'],
        "vertical_label" => $_GET['vl'], "title" => $_GET['title'],
  "glegend" => $_GET['glegend']);
@waxie

This comment has been minimized.

Show comment Hide comment
@waxie

waxie Apr 16, 2012

adding sanitize() in views.php does not seem to work either

waxie commented Apr 16, 2012

adding sanitize() in views.php does not seem to work either

@waxie

This comment has been minimized.

Show comment Hide comment
@waxie

waxie Apr 16, 2012

my view contains:


  "view_name": "cert_osd",
  "default_size": "xlarge",
  "items": [
    {
      "aggregate_graph": "true",
      "metric_regex": [
        {
          "regex": "(asm1|calligo|escience|footsteps|gina|grid|huygens|lifescience|lisa|vis)_failed"
        }
      ],
      "host_regex": [
        {
          "regex": "footsteps"
        }
      ],
      "graph_type": "stack",
      "vertical_label": "# attempts",
      "title": "SSH failed login attempts",
      "glegend": "show"
    },

This results in the following graph html in the view:


img id="graph_img_view_0" class="noborder host_default_zoomable" style="margin-top:5px;" src="graph.php?hreg[]=footsteps&mreg[]=%28asm1%7Ccalligo%7Cescience%7Cfootsteps%7Cgina%7Cgrid%7Chuygens%7Clifescience%7Clisa%7Cvis%29_failed&z=xlarge&gtype=stack&vl=# attempts&title=SSH+failed+login+attempts&glegend=show&aggregate=1&r=hour"

waxie commented Apr 16, 2012

my view contains:


  "view_name": "cert_osd",
  "default_size": "xlarge",
  "items": [
    {
      "aggregate_graph": "true",
      "metric_regex": [
        {
          "regex": "(asm1|calligo|escience|footsteps|gina|grid|huygens|lifescience|lisa|vis)_failed"
        }
      ],
      "host_regex": [
        {
          "regex": "footsteps"
        }
      ],
      "graph_type": "stack",
      "vertical_label": "# attempts",
      "title": "SSH failed login attempts",
      "glegend": "show"
    },

This results in the following graph html in the view:


img id="graph_img_view_0" class="noborder host_default_zoomable" style="margin-top:5px;" src="graph.php?hreg[]=footsteps&mreg[]=%28asm1%7Ccalligo%7Cescience%7Cfootsteps%7Cgina%7Cgrid%7Chuygens%7Clifescience%7Clisa%7Cvis%29_failed&z=xlarge&gtype=stack&vl=# attempts&title=SSH+failed+login+attempts&glegend=show&aggregate=1&r=hour"

jbuchbinder added a commit that referenced this issue Apr 18, 2012

@jbuchbinder

This comment has been minimized.

Show comment Hide comment
@jbuchbinder

jbuchbinder Apr 18, 2012

Member

Okay, I think I tracked this down. In function.php's get_view_graph_elements(), a number of parameters used to form URLs are not sanitized. I just merged in #76 which sanitizes those variables when creating the views.

Member

jbuchbinder commented Apr 18, 2012

Okay, I think I tracked this down. In function.php's get_view_graph_elements(), a number of parameters used to form URLs are not sanitized. I just merged in #76 which sanitizes those variables when creating the views.

@waxie

This comment has been minimized.

Show comment Hide comment
@waxie

waxie Apr 19, 2012

I can confirm this fixes it. Thanks!

However I would like to note the y-label now shows \# in the graph. It works but is not entirely pretty

waxie commented Apr 19, 2012

I can confirm this fixes it. Thanks!

However I would like to note the y-label now shows \# in the graph. It works but is not entirely pretty

@jbuchbinder

This comment has been minimized.

Show comment Hide comment
@jbuchbinder

jbuchbinder Apr 19, 2012

Member

The issue is double encoding -- we probably need to strip slashes.

Member

jbuchbinder commented Apr 19, 2012

The issue is double encoding -- we probably need to strip slashes.

jbuchbinder added a commit to jbuchbinder/ganglia-web that referenced this issue Apr 19, 2012

jbuchbinder added a commit that referenced this issue Apr 19, 2012

Merge pull request #77 from jbuchbinder/master
fix for #67, additional html fixes/tweaks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment