DevCentral community user mkelly kicked in some excellent Ruby contributions a while back with some scripts that Colin wrapped  some documentation around in an article series back in January:

This week, another community member, josb, contributed a SOAP4R wrapper for iControl.  I'm not familiar at all with Ruby, but I downloaded the windows version of the language (sorry Colin), installed the SOAP4R gem, and tried out josb's scripts.  Here's one example:

GetPools.rb

#!/usr/bin/env ruby# vim:expandtab shiftwidth=2 softtabstop=2require 'f5'Kernel.abort "Usage: #{$0} endpoint [poolname ...]" if ARGV.empty?hostname, *pools = ARGVlb = F5::LoadBalancer.new(hostname)pools = pools.empty? ? lb.pools : pools.map {|pool| F5::LoadBalancer::Pool.new(lb, pool)}pools.each do |pool|  members = lb.pool(pool).members  puts "Pool #{pool.name}: " + members.map {|member| "#{member.address}:#{member.port}"}.join(', ')endexit

 

And of course, the (sanitized) output:

Pool pool3: 10.10.40.57:80, 10.10.40.58:80, 10.10.40.59:80
Pool pool2: 10.10.40.54:80, 10.10.40.55:80, 10.10.40.56:80
Pool pool1: 10.10.40.51:80, 10.10.40.52:80, 10.10.40.53:80
Pool gateway_pool: 10.10.10.1:0
Pool cacti_ssh_rd1: 10.10.40.50:22, 10.10.40.50%1:22
Pool pool1_rd1: 10.10.40.51%1:80, 10.10.40.52%1:80, 10.10.40.53%1:80

Not too shabby!  Thanks, josb, for sharing with the community!  And community, josb is soliciting feedback, so please post if you want to assist in expanding / improving the project.

 

Follow me on Twitter Follow me on LinkedIn Follow me on Facebook Add to Technorati Favorites