I have the code to give the pools, and virtual ips for a wideip, but I also want to include the server and enabled state for each vip, but have reached a stumbling block and can’t seem to submit the right info.
The code block I have in my script is:
wip = dig(ARGV[0])
bigip = F5::IControl.new("{gtm}", ENV['BIP_USER'], ENV['BIP_PASS'], ["GlobalLB.WideIP","GlobalLB.Pool","GlobalLB.PoolMember"]).get_interfaces
wip_pools = bigip["GlobalLB.WideIP"].get_wideip_pool(wip)[0]
wip_pools = wip_pools.map do |wip_pool|
wip_pool = wip_pool.pool_name
wip_pool = wip_pool.to_a.push(bigip["GlobalLB.Pool"].get_enabled_state(wip_pool))
vips = bigip["GlobalLB.Pool"].get_member(wip_pool[0])[0]
vips = vips.map do |vip|
vip = [vip.member.address,vip.member.port]
puts "Debug {wip_pool[0]}"
puts "Debug {vip[0]} : {vip[1]}"
vip = vip.push(bigip["GlobalLB.PoolMember"].get_enabled_state(wip_pool[0],[vip]))
puts "Debug {vip[0]} : {vip[1]} - {vip[2]}"
vip = vip.push(bigip["GlobalLB.PoolMember"].get_dependency(wip_pool[0],[vip]))
puts "Debug {vip[0]} : {vip[1]} - {vip[2]} Server: {vip[3]}"
end
end
but when I try running it I get:
-bash-4.1$ ./wideip.rb www.***.com
Debug www.***.com-default
Debug **.**.**.** : 80
: Cannot convert null value to unsigned long. (SOAP::FaultError)
I believe it is the IPPortDefinition that it wants that I am doing incorrectly. Any help would be appreciated.