Skip to content

Instantly share code, notes, and snippets.

@justinledwards
Created December 2, 2013 22:09
Show Gist options
  • Save justinledwards/7759990 to your computer and use it in GitHub Desktop.
Save justinledwards/7759990 to your computer and use it in GitHub Desktop.
Voxeo Load Dashboard
require 'nokogiri'
require 'open-uri'
@servers = Server.where(:active => true)
@servers.each do |s|
url = "http://" + s.ip_address + ":9999/stats_10?type=counters"
doc = Nokogiri::XML(open(url))
s.ports_in_use = doc.xpath("//counters/item[@name='CT/Licensed/Ports']").text.to_i
s.ports_total = doc.xpath("//counters/item[@name='CT/Licensed/Licensed']").text.to_i
s.save
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment