Skip to content

Instantly share code, notes, and snippets.

@chrisa
Created December 14, 2012 14:41
Show Gist options
  • Select an option

  • Save chrisa/4285907 to your computer and use it in GitHub Desktop.

Select an option

Save chrisa/4285907 to your computer and use it in GitHub Desktop.
- data-source="/render?from=-3hours&format=json<%= @instance.resources.webs.map {|w| '&target=gmetad.*.' + w.hostname.tr('.', '_') + '.load_one' }
+ data-source="<%= render(:partial => 'webserver_load', :locals => { 'format' => 'json' }).html_safe %>">
from "-3hours"
webs = info['instance'].resources.webs.map do |web|
web.hostname.tr('.', '_')
end
webs.each do |web|
field web, :data => "collectd.#{web}.load.load.shortterm"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment