Forum Discussion
Ruby iControl, using GlobalLB.PoolMember
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
endbut 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.
2 Replies
- IheartF5_45022
Nacreous
I've never seen Ruby before but it seems that {vip[1]} is 80...what is {vip[2]} ?It's the only variable that hadn't been previously referenced.....
- Tyler_04_143455
Nimbostratus
bigip["GlobalLB.PoolMember"].get_enabled_state(wip_pool[0],[vip]) is being pushed into the vip array. So if get_enabled_state were successful (currently it is not) then that result would vip[2]
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com